emulsion icon indicating copy to clipboard operation
emulsion copied to clipboard

Show correct info popup if user has overridden keyboard bindings (shortcuts)

Open vn971 opened this issue 3 years ago • 4 comments

If bindings / keyboard shortcuts are configured as per documentation here https://arturkovacs.github.io/emulsion-website/bindings.html Then the info popup will still show the default keys. This makes sense internally because the info popup is an image, I checked that while trying to make a PR... The question is, is there a technical solution on how to show the info popup as text, not image? I could imagine that could help with translations as well, though translations is not in the scope of this issue

vn971 avatar Mar 01 '21 08:03 vn971

is there a technical solution on how to show the info popup as text, not image?

There is no simple way to do this at this time. Emulsion's UI framework, gelatin, doesn't support text rendering currently. However I believe it would be possible using the resvg crate. But still, some sort of a text widget (and maybe a table widget) would have to be added to gelatin. I probably won't work on this in the foreseeable future, as there are many open issues for this repo, which to me are more important and I have little time for emulsion development. With that said, pull requests are welcome, but know that this is a difficult one.

ArturKovacs avatar Mar 01 '21 08:03 ArturKovacs

@ArturKovacs would it be a possible path to implement SVG rendering indeed, and then just construct the SVG's code to contain the desired text by hand? It'll be SVG's job to figure out how to do the layout then

(Note: I don't think I have available time for SVG integration at the moment, but I'm curious)

vn971 avatar Mar 01 '21 10:03 vn971

Oh BTW, I noticed that emulsion did add support for svg just recently, after the latest release 0.8. Should we release it as 0.8.1 or 0.9? I could also see if I can load a custom-made SVG instead of the png image then

vn971 avatar Mar 02 '21 06:03 vn971

would it be a possible path to implement SVG rendering indeed, and then just construct the SVG's code to contain the desired text by hand?

Yes it would be possible, but as far as I know, SVG doesn't do layout . This means that the position of the text would still have to be specified somehow. In this case it would be cleaner and probably not much more complicated to add a text widget type to gelatin. So if you would like to experiment with it, I think it would be best if you attempted to implement a some sort of Text widget. See subcrates/gelatin/src/label.rs for an example of a widget.

I noticed that emulsion did add support for svg just recently

Note that this SVG support is mostly experimental, as loaded images are rasterized once, during load (they get pixelated if you zoom in).

Should we release it as 0.8.1 or 0.9?

I'm assuming you meant 8.1 or 9.0. And the answer is 9.0. Emulsion uses the major version to indicate regular releases, and uses the minor version number to indicate patches/hotfixes. The "patch" version is not used, that is, it's always 0. Also I'm pretty sure that the next release won't happen according to the milestone. I'll delay it, but I don't yet know whet it should happen.

ArturKovacs avatar Mar 03 '21 18:03 ArturKovacs