eclipse.platform.swt icon indicating copy to clipboard operation
eclipse.platform.swt copied to clipboard

Disabled Icon Viewer Snippet

Open killingerm opened this issue 11 months ago • 7 comments

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.

killingerm avatar Jan 20 '25 18:01 killingerm

Test Results

   545 files  + 6     545 suites  +6   27m 10s ⏱️ - 9m 7s  4 377 tests +37   4 359 ✅ +35   18 💤 +3  0 ❌  - 1  16 647 runs  +37  16 506 ✅ +35  141 💤 +3  0 ❌  - 1 

Results for commit 6463e78f. ± Comparison against base commit 995c9b51.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Apr 23 '25 20:04 github-actions[bot]

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

akurtakov avatar May 02 '25 05:05 akurtakov

@akurtakov I signed the ECA long ago but then changed my GitHub username to killigerm (to better reflect my name). I tried to relink it to my eclipse account but got a notification to send a mail to correct it, so far I sent two of them. I've also tried the "Eclipse ECA Validation" plugin. Is there anything else I can try?

killingerm avatar May 05 '25 13:05 killingerm

I'm deferring to @eclipsewebmaster as I can't help with this one.

akurtakov avatar May 05 '25 14:05 akurtakov

Thank you @akurtakov, @HeikoKlare and @eclipsewebmaster, it should work now.

killingerm avatar May 06 '25 14:05 killingerm

Thank you, @killingerm! The ECA validation is fine now. Can you please address the review comments so that we can merge afterwards?

HeikoKlare avatar May 06 '25 15:05 HeikoKlare

Hi again, @HeikoKlare I have now applied the requested changes:

  • Linked the Disabled Icon Viewer Snippet (Snippet 348) in Snippets.md under the image section
  • Added Javadoc describing the Snippets functionality
  • Squashed everything into a single commit

I believe it has worked, though I'm not entirely sure whether the .prefs and .project files are supposed to be in the commit.

Also, since a new icon-disablement algorithm was selected I made a few adjustments:

  • Added the new disabling algorithm directly underneith the original images
  • Changed the order of algorithms with priority current -> old -> experimental
  • Updated sliders default values to the ones agreed on in the discussion thread
  • Replaced the preview image:

Snippet384

Please have a look at it and let me know if everything is in order this way or further changes are needed!

Lastly I'm really glad the snippet was helpful and is added into the repository, thank you!

killingerm avatar May 09 '25 10:05 killingerm