Bug 575036 - [GTK] Disabled image of ToolItem is not greyed out
Summary: [GTK] Disabled image of ToolItem is not greyed out
Status: CLOSED INVALID
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.17   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2021-07-26 08:33 EDT by Simeon Andreev CLA
Modified: 2021-08-04 04:43 EDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Simeon Andreev CLA 2021-07-26 08:33:29 EDT
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.
Comment 1 Andrey Loskutov CLA 2021-08-03 13:21:05 EDT
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.
Comment 2 Simeon Andreev CLA 2021-08-04 04:43:36 EDT
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.