Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Follow-Up Feature: Icon-Enablement with Rasterization of SVGs #1647

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Michael5601
Copy link

@Michael5601 Michael5601 commented Dec 11, 2024

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:
image

Automatically customized at runtime with the new functionality:
image

The following tasks need to be completed for this draft:

  1. Decide whether the unification of the behavior across different operating systems should occur before merging the new functionality.
  2. Merge the main feature upon which this draft is based.
  3. Remove disabled icon paths from the plugin.xml files to ensure the automatic customization is triggered.
  4. Write documentation (JavaDocs) for the new API.
  5. Provide regression tests and a performance comparison between automatic customization and FileIO for pre-created icons. The possibility exists that the rasterization with pre-processing is faster than the additional FileIO to load the pre-created icons.

Fixes #1438.

@BeckerWdf
Copy link
Contributor

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: image

Automatically customized at runtime with the new functionality: image

To be honest I almost cannot see a difference. So I think this should not be a problem.

@Michael5601
Copy link
Author

To be honest I almost cannot see a difference. So I think this should not be a problem.

This is a good thing for me. :) We could utilize the new behaviour from this draft, which means the pre-created PNGs can be removed and we have a little improvement in the look of the icons without changing their appearance (gray tone) too much.

@Michael5601 Michael5601 force-pushed the IconScalingWithDisabledLogic branch 9 times, most recently from e0a66ba to 67d7433 Compare December 18, 2024 11:38
@Michael5601 Michael5601 force-pushed the IconScalingWithDisabledLogic branch 2 times, most recently from e563ae4 to 81714d1 Compare January 7, 2025 08:33
disabled icon logic
@Michael5601 Michael5601 force-pushed the IconScalingWithDisabledLogic branch from 81714d1 to b85ad40 Compare January 7, 2025 08:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improving Eclipse Icon Scaling by Supporting Vectorized Icons
2 participants