Skip to content

Disabled Icon Viewer Snippet #1740

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

Draft
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

killingerm
Copy link
Contributor

@killingerm killingerm commented Jan 20, 2025

This draft includes Snippet384 to inspect the behavior of the current icon-disabling algorithms implemented in the constructor of org.eclipse.swt.graphics.Image(Device, Image, int) when called with the SWT.IMAGE_DISABLE flag.

Currently, there are two different algorithms depending on whether Windows/MacOS or Linux is used. The Windows/MacOS implementation is outdated, and the generated disabled icons often look unappealing.

The snippet includes two new algorithms that can serve as a foundation for deriving a new algorithm, with adjustable parameters. This unified approach could also be applied to the Eclipse icons provided in disabled state, ensuring consistent appearance across all disabled icons, whether included in Eclipse JARs or generated dynamically using the Image constructor.

How to Use

  1. Select a folder containing images.
  2. Adjust the sliders to modify the parameters of the new algorithms.

Example Images

I have included example images that demonstrate the weaknesses of the current algorithms and created a resource folder:
resources/Snippet384/Example Images.

For detailed information and to participate in discussions about changes to the algorithm, please refer to the accompanying discussion thread.

Copy link
Contributor

github-actions bot commented Apr 23, 2025

Test Results

   545 files  + 6     545 suites  +6   31m 0s ⏱️ + 1m 58s
 4 374 tests +37   4 356 ✅ +36   18 💤 +3  0 ❌  - 2 
16 638 runs  +37  16 498 ✅ +36  140 💤 +3  0 ❌  - 2 

Results for commit 95dc5d5. ± Comparison against base commit 8efc599.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@HeikoKlare HeikoKlare left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@killingerm I think it would be nice to have this snippet in the repository, even though we already have multiple algorithms implemented productively now, as it allows for easier testing of alternatives and reconfigurations.

To do so, would you please squash your commits into one and sign the Eclipse Contributor Agreement (ECA)?

In addition, we need to link the new snippet in the Snippets.md file at the root of the org.eclipse.swt.snippets bundle. I would propose to add this snippet to the Image section of that markdown file.

import org.eclipse.swt.layout.*;
import org.eclipse.swt.widgets.*;

public class Snippet384 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a comment to the class used as the description of the snippet shown in the snippet explorer (see other snippets for a template).

killingerm added 5 commits May 2, 2025 08:31
Created Snippet384 to inspect the behaviour of current icon disabling algorithms and propose new ones.
Changed HSB disabling to a more genralized version, added eclipse mojo disabling and dark themes.
Fixed Combobox default theme
Added alpha slider for additional gray disabling.
@akurtakov
Copy link
Member

@killingerm You have to sign Eclipse contributor agreement in order for your PR to be reviewed - https://www.eclipse.org/legal/eca/

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.

3 participants