Skip to content

Commit b90e5fc

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 3b3a84f commit b90e5fc

File tree

4 files changed

+33
-1
lines changed

4 files changed

+33
-1
lines changed
4.7 KB
Loading
4 KB
Loading
5.17 KB
Loading

news/4.35/platform.html

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,39 @@ <h2>Themes and Styling </h2>
123123
</p>
124124
</td>
125125
</tr>
126-
<!-- ******************* End of Themes and Styling ************************************* -->
126+
<tr id="improvedDisabledIcons"> <!-- https://github.com/eclipse-platform/eclipse.platform.swt/pull/1936 -->
127+
<td class="title">Improved Disabled Icons Generation</td>
128+
<td class="content">
129+
<p>
130+
Up to now, disabled versions of icons usually were and had to be provided as explicit, separate image files. In case no such icon was provided, an algorithm in SWT was used to generate a disabled icon. However, that algorithm was very limited and produced hardly usable results.
131+
</p>
132+
<p>
133+
The algorithm in SWT was now improved such that results are by default equal to the disabled version of the icons that have explicitly been provided for the Eclipse Platform bundles. In consequence, those pre-generated disabled icons are replaced with the usage of on-the-fly generated disabled versions of the icons via the SWT algorithm.
134+
This particularly includes the removal of <code>disabledIcon</code> in <code>plugin.xml</code> files and setting the <code>disabledImageDescriptor</code> within code for <code>Actions</code>.
135+
</p>
136+
<p>
137+
In addition, the algorithm for the calculation of disabled versions of icons became exchangeable. The algorithm can be changed via the system property <code>org.eclipse.swt.image.disablement</code> with the following options:
138+
</p>
139+
<ul>
140+
<li><code>grayed</code> (default): produces a gray-scaled version of the icon, which is aligned with the existing, pre-generated disabled versions of icons for Eclipse bundles</li>
141+
<li><code>gtk</code>: produces an icon version that conforms with the default disablement algorithm of GTK</li>
142+
<li><code>desaturated</code> (preview): produces a desaturated version of the icon, comparable to the <code>grayed</code> version but still keeping some color in it; the configuration of this option may be subject to change in future releases of Eclipse</li>
143+
</ul>
144+
<p>
145+
The following screenshots show the different options. The screenshot for the <code>gtk</code>
146+
</p>
147+
<p>
148+
<img src="images/disabled_icons_grayed.png" alt="Disablement option 'grayed'"/> &nbsp<code>grayed</code> (default)
149+
</p>
150+
<p>
151+
<img src="images/disabled_icons_gtk.png" alt="Disablement option 'gtk'"/> &nbsp<code>gtk</code>
152+
</p>
153+
<p>
154+
<img src="images/disabled_icons_desaturated.png" alt="Disablement option 'desaturated'"/> &nbsp<code>desaturated</code> (preview)
155+
</p>
156+
</td>
157+
</tr>
158+
<!-- ******************* End of Themes and Styling ************************************* -->
127159

128160
<!-- ******************* General Updates ************************************* -->
129161
<tr>

0 commit comments

Comments
 (0)