org.eclipse.rap
org.eclipse.rap copied to clipboard
Support for SVG Images for Actions, Commands and Menu's for HighDPI and zooming support
Hi,
while it's possible to embed SVG images by using custom markup e.g. for a Label (documentation is here) there seems no way to embed SVG images for all kinds of elements defined in the plugin.xml. e.g.:
- Actions
- Commands and Command Images
- (Menus - which contain commands and other contributions)
Actions e.g. are configured with an ImageDescriptor which get's later on transformed into an SWT image and in RAP are referenced e.e. in as div like
<div style="position: absolute; opacity: 0.3; background: url("rwt-resources/generated/a4264674.png") no-repeat; left: 4px; width: 16px; top: 4px; height: 16px;"></div>
This has the problem that it's not working properly on HighDPI displays or when the users uses the browser's zoom function.
What could be a way to use SVG images for this workbench elements?
We thought of a kind of mapping mechanism, which ask a central code part for a replacement of a defined image path+filename which could return a path+filename to a svg instead.
Or a central place in the platform, somehow similar to the org.eclipse.jface.resource.FileImageDescriptor.getxName
mechanism. Where there is the problem that everthing is based on pixels ...
But there may be better ways to solve that
We have found similar demands here:
- https://bugs.eclipse.org/bugs/show_bug.cgi?id=561420
- https://github.com/eclipse-rap/org.eclipse.rap/issues/72#issuecomment-1300094443
Thanks for any hints on this.
Bye Peter