Follow-Up Feature: Icon-Enablement with Rasterization of SVGs #1647
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This draft outlines the follow-up functionality for the PR (Feature Proposal: Rasterization of SVGs at Runtime for Eclipse Icons).
The commit 4e6abc7 contains the new functionality that extends the base functionality of the mentioned PR. All future changes to the PR will be performed to this draft.
The new functionality extends the current automatic customization of icons in the
Image(Device device, Image srcImage, int flag)
constructor. While all of the core functionality is implemented within SWT, some changes are required in Platform UI, which can be found in the following Draft.When the
Image
constructor is invoked, the new functionality attempts to create a graphically customized icon by passing a specific flag (e.g.,SWT.IMAGE_DISABLE
) to the rasterization functionality introduced in the base PR. This functionality is enhanced by a preprocessing step that automatically adds a filter to the SVG before rasterization. These filters are designed to ensure that the resulting icons resemble the current pre-created disabled/gray icons loaded at runtime.It is important to note that the automatic icon customization differs between GTK and Cocoa/Win32. As such, the icons generated with the new functionality may not align perfectly with the automatically customized GTK icons. However, this discrepancy is also present with the current pre-created icons, so the impact is minimal. Additionally, most icons are pre-created and not automatically customized at runtime.
Below is a comparison between the current pre-created icons and the icons customized automatically at runtime using the new functionality. The color/saturation/brightness can be changed by adjusting the filter:
Pre-created and scaled down to 125% device zoom:
Automatically customized at runtime with the new functionality:
The following tasks need to be completed for this draft:
plugin.xml
files to ensure the automatic customization is triggered.Fixes #1438.