eclipse-platform / eclipse.platform.swt

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

Dropdown Triangle of Toolbar Items Are Hardly Visible in Dark Theme #1233

Open BeckerWdf opened 1 month ago

BeckerWdf commented 1 month ago

Describe the bug Use Eclipse with Dark Theme. The drop down triangle of tool bar items is black and can hardly be seen in the dark theme.

To Reproduce Start the Eclipse IDE with dark theme.

Expected behavior I expect the triangle to be light in dark theme and dark in light mode.

Screenshots

old_dark

Environment:

  1. Select the platform(s) on which the behavior is seen:

      • [ ] All OS
      • [x] Windows
      • [ ] Linux
      • [x] macOS
  2. Additional OS info (e.g. OS version, Linux Desktop, etc)

  3. JRE/JDK version

Version since Eclipse or SWT version since when the behavior is seen [e.g. 4.23]

Workaround (or) Additional context Add any other context about the problem here. Any known workarounds for the problem?

BeckerWdf commented 3 weeks ago

For macOS we now have a fix of that. Can somebody have a look into this for linux and macOS?

Kuba3105 commented 3 weeks ago

In the Windows environment, Eclipse obtains the drop-down triangle functionality from the Win32 API, using the BTNS_DROPDOWN (org.eclipse.swt.widgets.ToolItem.widgetStyle()). To my knowledge, there doesn’t seem to be an option to adjust the brightness through the Win32 API. I plan to investigate how this works in the Linux environment and attempt to implement a solution.

BeckerWdf commented 3 weeks ago

To my knowledge, there doesn’t seem to be an option to adjust the brightness through the Win32 API.

Thanks for finding out.

I plan to investigate how this works in the Linux environment and attempt to implement a solution.

Thanks for investing your time

Kuba3105 commented 2 weeks ago

In Linux, there are already arrow icons that adapt to dark mode. They change to a light gray color.

image

akurtakov commented 2 weeks ago

FYI On Linux we have a little trick - defer to Gtk/OS to do that for us whenever dark theme is chosen (https://github.com/eclipse-platform/eclipse.platform.ui/blob/954bc581051c3f0a5ebcacc1d85492d2acd85707/bundles/org.eclipse.e4.ui.swt.gtk/src/org/eclipse/e4/ui/swt/internal/gtk/DarkThemeProcessor.java#L48) . All that it does is notify GTK to adjst for dark theme (https://github.com/eclipse-platform/eclipse.platform.swt/blob/f708ac39ba2575b1f04541b1313ecfe467493cd6/bundles/org.eclipse.swt/Eclipse%20SWT%20PI/gtk/org/eclipse/swt/internal/gtk/OS.java#L1876).

BeckerWdf commented 2 weeks ago

FYI On Linux we have a little trick - defer to Gtk/OS to do that for us whenever dark theme is chosen (https://github.com/eclipse-platform/eclipse.platform.ui/blob/954bc581051c3f0a5ebcacc1d85492d2acd85707/bundles/org.eclipse.e4.ui.swt.gtk/src/org/eclipse/e4/ui/swt/internal/gtk/DarkThemeProcessor.java#L48) . All that it does is notify GTK to adjst for dark theme (

https://github.com/eclipse-platform/eclipse.platform.swt/blob/f708ac39ba2575b1f04541b1313ecfe467493cd6/bundles/org.eclipse.swt/Eclipse%20SWT%20PI/gtk/org/eclipse/swt/internal/gtk/OS.java#L1876

).

@Kuba3105: Is something similar possible on windows?

Kuba3105 commented 1 week ago

I have conducted some tests and found that it is probably not possible to change the arrows. MacOS and GTK natively support Dark Mode, but the Win32 API does not fully. Therefore, this cannot be implemented in the same way as with GTK. There are methods to support Dark Mode, but these are currently not documented by Microsoft and do not work with the toolbar. In general, the support of Dark Mode by the Win32 API is not optimal, but Microsoft is working on improving this. In Eclipse, Dark Mode is simulated through the method org.eclipse.swt.internal.win32.OS.setTheme(boolean). This method adjusts various settings to create a Dark Mode.

BeckerWdf commented 1 week ago

So should we then close this issue or keep it open waiting for some new possibilities in the Win32 API?

Kuba3105 commented 1 week ago

I would leave it open in case there are any changes to the API. Windows is working on implementing the Dark Mode.