Community
Participate
Working Groups
Snippet to reproduce with: public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); ToolBar toolBar = new ToolBar(shell, SWT.FLAT | SWT.WRAP | SWT.RIGHT); Image icon1 = display.getSystemImage(SWT.ICON_QUESTION); ToolItem item3 = new ToolItem(toolBar, SWT.PUSH); item3.setText("disabled"); Image icon3 = display.getSystemImage(SWT.ICON_WARNING); item3.setEnabled(false); item3.setDisabledImage(icon3); item3.setImage(icon1); toolBar.pack(); shell.addListener(SWT.Resize, new Listener() { public void handleEvent(Event event) { Rectangle clientArea = shell.getClientArea(); toolBar.setSize(toolBar.computeSize(clientArea.width, SWT.DEFAULT)); } }); shell.setSize(500, 100); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } Observe that the disabled image is not greyed out, but was, e.g. in Eclipse 4.16. Regression from bug 564097.
I've observed the effect of that in our application and in all cases that was a mistake to provide a "not disabled" icons as a disabled one and hope SWT will do something to make the icon look as disabled. Either one should not provide a disabled icon, or SWT should not mess up and apply "disabled" effect on already dedicated "disabled" icon. I would close this as won't fix / invalid.
Behaviour on Windows 10 is similar to what we currently see on SWT. Setting a disabled icon will not result in SWT greying out that icon. So no argument to be made for consistency across platforms, that now broke.