Skip to content

Replace pre-generated disabled icon with on-the-fly generated ones#2190

Merged
jjohnstn merged 2 commits intoeclipse-jdt:masterfrom
HeikoKlare:disabled-remove
Apr 29, 2025
Merged

Replace pre-generated disabled icon with on-the-fly generated ones#2190
jjohnstn merged 2 commits intoeclipse-jdt:masterfrom
HeikoKlare:disabled-remove

Conversation

@HeikoKlare
Copy link
Copy Markdown
Contributor

@HeikoKlare HeikoKlare commented Apr 28, 2025

❗ This now includes the changes of and should thus be merged after #2189

What it does

SWT's algorithm to calculate disabled icons on the fly has been enhanced to produce results that are equal to the existing, pre-generated disabled icons being used. This makes the usage of pre-generated disabled icons obsolete. This is particularly important for the introduction of SVG icons, as the quality of on-the-fly generated disabled icons based on the original SVGs is better for arbitrary zooms than the scaled up or scaled downs versions of the PNG-based disabled icons.

This change removes all explicit specifications of disabled image descriptors or replaces them with image descriptors derived from their enabled version.

This can be merged independent from the PRs introducing SVGs but might make sense to merge before as otherwise the enabled (SVG-based) and disabled (PNG-based) icons may be of different sharpness as specific monitor zoom values:

How to test

Start a product and check whether the disabled versions of the affected icons still look the same.
Since those disabled version are not generated on the fly and since that algorithm is configurable, it will be possible to notice different kinds of disablement when using flags like -Dorg.eclipse.swt.image.disablement=desaturated or -Dorg.eclipse.swt.image.disablement=gtk. Without any flag, the result should be just the same as the original, pre-generated icons.

One rather special place is the usage of icons in the FormatterModifyDialog, where the disabled icons are manually embedded in menu items showing different kinds of, e.g., line wrapping styles. In most other cases, those icons are referenced via image descriptors in ActionContributionsItems resulting in ToolItems.
The formatter modify dialog still shows proper enabled and disabled icons.
This is how it looked before the change (and after the change if none of the above options is specified):
formatter_disabled_original

And this is how it looks like with -Dorg.eclipse.swt.image.disablement=desaturated:
formatter_disabled_unsaturated

Author checklist

@eclipse-jdt-bot
Copy link
Copy Markdown
Contributor

This pull request changes some projects for the first time in this development cycle.
Therefore the following files need a version increment:

org.eclipse.jdt.junit/META-INF/MANIFEST.MF

An additional commit containing all the necessary changes was pushed to the top of this PR's branch. To obtain these changes (for example if you want to push more changes) either fetch from your fork or apply the git patch.

Git patch
From ee7dd577bdf42feca71e875d9c23f587eec2b4ea Mon Sep 17 00:00:00 2001
From: Eclipse JDT Bot <jdt-bot@eclipse.org>
Date: Mon, 28 Apr 2025 15:17:18 +0000
Subject: [PATCH] Version bump(s) for 4.36 stream


diff --git a/org.eclipse.jdt.junit/META-INF/MANIFEST.MF b/org.eclipse.jdt.junit/META-INF/MANIFEST.MF
index 479842b295..47b5b5f07a 100644
--- a/org.eclipse.jdt.junit/META-INF/MANIFEST.MF
+++ b/org.eclipse.jdt.junit/META-INF/MANIFEST.MF
@@ -3,7 +3,7 @@ Automatic-Module-Name: org.eclipse.jdt.junit
 Bundle-ManifestVersion: 2
 Bundle-Name: %pluginName
 Bundle-SymbolicName: org.eclipse.jdt.junit;singleton:=true
-Bundle-Version: 3.17.0.qualifier
+Bundle-Version: 3.17.100.qualifier
 Bundle-Activator: org.eclipse.jdt.internal.junit.ui.JUnitPlugin
 Bundle-ActivationPolicy: lazy
 Bundle-Vendor: %providerName
-- 
2.49.0

Further information are available in Common Build Issues - Missing version increments.

@jjohnstn
Copy link
Copy Markdown
Contributor

@HeikoKlare Please resolve conflicts and resubmit.

@HeikoKlare
Copy link
Copy Markdown
Contributor Author

I have just rebased this on #2189 and resolved the conflicts.
❗ So this now includes the changes of and should thus be merged after #2189
Otherwise we would have another round of rebasing as the two PRs affect adjacent lines of code.

@jjohnstn
Copy link
Copy Markdown
Contributor

/rebase

HeikoKlare and others added 2 commits April 29, 2025 16:04
SWT's algorithm to calculate disabled icons on the fly has been enhanced
to produce results that are equal to the existing, pre-generated
disabled icons being used. This makes the usage of pre-generated
disabled icons obsolete. This is particularly important for the
introduction of SVG icons, as the quality of on-the-fly generated
disabled icons based on the original SVGs is better for arbitrary zooms
than the scaled up or scaled downs versions of the PNG-based disabled
icons.

This change removes all explicit specifications of disabled image
descriptors or replaces them with image descriptors derived from their
enabled version.
@jjohnstn jjohnstn merged commit 1f40aa1 into eclipse-jdt:master Apr 29, 2025
6 checks passed
@HeikoKlare HeikoKlare deleted the disabled-remove branch March 27, 2026 19:38
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