eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
101 stars 124 forks source link

Windows 10: SWT.COLOR_TITLE_* constants don't allow to get title color #11

Open tmssngr opened 2 years ago

tmssngr commented 2 years ago

Please run the attached snippet. It will show the colors reported by the different SWT.COLORTITLE* constants. As you see, they obviously differ from the title color. screenshot

TitleColor.txt

lathapatil commented 12 months ago

could anyone elaborate the issue ?

tmssngr commented 12 months ago

Well, none of the used display.getSystemColor invocations returns the used title color (white - as you can see from the screenshot). If the API needs to be fixed, fix it. If it is not supported any more by the OS, deprecate and later remove it.

mickaelistria commented 12 months ago

Note that you can use the ControlExample to share the color palette, that can save a few minutes in building a snippet.

COLORTITLE* do work as expected on other OS, so they probably shouldn't be deprecated. If win32 doesn't export equivalent colors any more, then SWT could try to build them heuristically: according to eg background and foreground color, mix them into something that can be fine for title.

deepika-u commented 12 months ago

I have tried it on below environment and see the same behavior as in the screen shot attached by Thomas Singer. Eclipse SDK Version: 2023-09 (4.29) Build id: I20230712-1800 OS: Windows 11, v.10.0, x86_64 / win32 Java vendor: Eclipse Adoptium Java runtime version: 20+36 Java version: 20

I totally understand there is no way to get the title color with SWT.COLORTITLE* constants.

But i figured out that we can set the title colors in the below manner as well, just thought if it might be of some help to anyone who is trying to set title colors (though not from SWT.COLORTITLE* constants - i agree).

Settings => Personalization => Accent color(Manual => select the color you want your title to show up with) and turn on "Show accent color on title bars and windows borders" option below Accent color. But yeah the color gets applied to both title bars and windows borders - both at once and cant be done one at a time.