Skip to content

Commit 62972df

Browse files
committed
Add N&N for improved disabled icons
This contributes an N&N informing about the icon disablement algorithm in SWT being improved and made configurable and the according removal of the usage of pre-generated disabled icons. See eclipse-platform/eclipse.platform.swt#1936
1 parent f3f030d commit 62972df

File tree

4 files changed

+29
-2
lines changed

4 files changed

+29
-2
lines changed
Loading
4 KB
Loading
5.17 KB
Loading

news/4.36/platform.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,37 @@
1616
## Preferences
1717
-->
1818

19-
<!--
2019
---
2120
## Themes and Styling
22-
-->
21+
22+
### Improved Disabled Icons Generation <!-- https://github.com/eclipse-platform/eclipse.platform.swt/pull/1936 -->
23+
Up to now, disabled versions of icons usually were and had to be provided as explicit, separate image files.
24+
In case no such icon was provided, an algorithm in SWT was used to generate a disabled icon. However, that
25+
algorithm was very limited and produced hardly usable results.
26+
27+
The algorithm in SWT was now improved such that results are by default equal to the disabled version of the
28+
icons that have explicitly been provided for the Eclipse Platform bundles. The pre-generated disabled icons
29+
have been replaced with the usage of on-the-fly generated disabled versions of the icons via the SWT algorithm.
30+
This particularly includes the removal of `disabledIcon` in `plugin.xml` files and programmatically setting the
31+
`disabledImageDescriptor` for `Actions`.
32+
33+
In addition, the algorithm for the calculation of disabled versions of icons became exchangeable. The
34+
algorithm can be changed via the system property `org.eclipse.swt.image.disablement` with the
35+
following options:
36+
- `grayed` (default): produces a gray-scaled version of the icon, which is aligned with the
37+
existing, pre-generated disabled versions of icons for Eclipse bundles
38+
- `desaturated` (preview): produces a desaturated version of the icon, comparable to the
39+
`grayed` version but still keeping some color in it; the configuration of this option may be
40+
subject to change in future releases of Eclipse
41+
- `gtk`: produces an icon version that conforms with the default disablement algorithm of GTK
42+
43+
The following screenshots demonstrate the different options.
44+
45+
| Option | Example |
46+
| --- | --- |
47+
| `grayed` | ![Disablement option 'grayed'](images/disabled_icons_grayed.png) |
48+
| `desaturated` | ![Disablement option 'desaturated'](images/disabled_icons_desaturated.png) |
49+
| `gtk` | ![Disablement option 'gtk'](images/disabled_icons_gtk.png) |
2350

2451
<!--
2552
---

0 commit comments

Comments
 (0)