Community
Participate
Working Groups
Created attachment 286691 [details] Screenshot from Eclipse 2021-06, gtk3, dark mode See attachment. Screenshot from Eclipse IDE for Java Developers (includes Incubating components) Version: 2021-06 (4.20.0) Build id: 20210612-2011 org.eclipse.swt.internal.deviceZoom=100 org.eclipse.swt.internal.gdk.backend=x11 org.eclipse.swt.internal.gtk.theme=Adwaita org.eclipse.swt.internal.gtk.version=3.22.30 Eclipse is set to dark mode via the Eclipse preferences; system theme is the stock Adwaita (light). The "M" is owner-drawn (see [1] for the code). It uses event.gc.getBackgroundColor() to fill the background of the "M". That rectangle is drawn with the selection color *of the light theme*. The selection color for the dark theme is a clearly different blue (and a lighter or brighter one at that). In the default light mode, the background color matches the selection color. I don't know where this selection color for tree items is defined, but I would expect the GC for a PaintEvent to be set to the correct color. [1] https://git.eclipse.org/r/c/egit/egit/+/182394/4/org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/staging/StagingView.java#b164
See also bug 574434 for a similar problem on win32 (but there SWT only).
This problem does _not_ occur when running an Eclipse Neon.3 in dark mode. So perhaps the color in event.gc.getBackground() is correct, but the brighter blue used for drawing the label is wrong?
(In reply to Thomas Wolf from comment #1) > See also bug 574434 for a similar problem on win32 (but there SWT only). Actually, the background color of a selected tree item as reported by event.gc.getBackground() in an SWT.PaintEvent not changing with the theme also occurs on win32. So this issue here * is not platform-specific; occurs on gtk3 and on win32. (Didn't see it on cocoa, though.) * is different from bug 574434, which is win32-specific and which is about that background color not matching the actual background color used for the tree item. (In light or dark mode.)