Community
Participate
Working Groups
Created attachment 282993 [details] Screenshot If I call setEnabled(false) it looses its background color, this looks really bad in the dark theme. Snippet to reproduce: ----- import org.eclipse.swt.SWT; import org.eclipse.swt.events.SelectionAdapter; import org.eclipse.swt.events.SelectionEvent; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.eclipse.swt.widgets.Table; import org.eclipse.swt.widgets.TableItem; public class SnippetTableBackground { public static void main (String [] args) { Display display = new Display (); Shell shell = new Shell (display); shell.setText("Snippet 301"); //$NON-NLS-1$ FillLayout layout = new FillLayout(); layout.marginHeight = 10; layout.marginWidth = 10; shell.setLayout(layout); Table table = new Table(shell, SWT.BORDER); table.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK)); table.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE)); for (int i=0; i<10; i++) { TableItem item = new TableItem (table, SWT.NONE); item.setText("Item " + i);//$NON-NLS-1$ } Button button = new Button(shell, SWT.PUSH); button.setText("Switch Enablement"); //$NON-NLS-1$ button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { table.setEnabled(!table.getEnabled()); } }); shell.pack (); shell.open (); while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } display.dispose (); } } ----- One example in the IDE is the Project Clean Dialog which can be triggered via Project -> Clean.
Nirja, Alexandr, please have a look. Works well on other platforms (at least Linux).
I can see the same problem in my native snippet. It also happens without `OS.setTheme(true)`. I do not expect that it will be easy to fix. Also, our product doesn't suffer from it, because we don't disable Tables. I'm afraid I won't be able to look into this, sorry. For some hints, search [1] for 'disabled'. [1] http://www.geoffchappell.com/studies/windows/shell/comctl32/controls/listview/background.htm
Thanks Alexandr for checking
New Gerrit change created: https://git.eclipse.org/r/163643
Turns out, SWT already had the necessary code! I submitted a patch with another `Display.setData()` knob.
Lars, would you please do the testing and also select specific color value you want for Eclipse?
Created attachment 283032 [details] Screenshot of disabled tree with patch Thanks Alexandr, looks better but it seems that the icon background still goes to light (see screenshot).
I notice, this issue got introduced in 4.12 via Bug 536621 - [win32][Table] Custom cell style on table doesn't work anymore is some cases
Hi Nikita, Appreciate your comments/review here.. Gerrit(https://git.eclipse.org/r/163643) tries to address the issue but it's not complete yet(image part is pending)
I have updated my patch: * It still doesn't fix icon background It seems that a workaround for Windows behavior is needed here. * `Display.setData()` knob is removed and replaced with a fix. As Niraj correctly pointed out, this was a regression from Bug 536621. Thanks for noticing! * It also fixes Bug 547989. * The test snippet was significantly improved to cover all problems.
*** Bug 540682 has been marked as a duplicate of this bug. ***
Gerrit change https://git.eclipse.org/r/c/platform/eclipse.platform.swt/+/163643 was merged to [master]. Commit: http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=a18ae7e17d79e32856fcf5e616c3839205a4be96
In master now.
Looks great, thanks a bunch!
Created attachment 283856 [details] Clean dialog with patch