Skip to content

#567 Handle dark-theme and theme update in standalone applications.

This merge request implements a possible solution to the breaking dependency to the Eclipse Workbench environment and workspace location for stand-alone application which implement dark mode.

Support Dark mode

To be able to run the stand-alone application, it needs to be able to do this without relying on the Eclipse theming facility. This however causes some issues because the OS mode (Dark or Light) also affects the color displayed by SWT. This means the stand-alone application still needs to change its colors based on the OS mode. For macOS and Linux, this can be solved as SWT supports the org.eclipse.swt.widgets.Display#isSystemDarkTheme() method. On Windows, however, this does not work as I would expect. SWT will only show Light theme, even when it detects Windows is set to Dark Mode.

Registering to runtime theme changes

Directly related to the previous problem is the fact that when the application depends on the theme, it also needs to register to dynamic theme changes. The initial, direct, issue is that currently theme changes are detected using the preferences in the Eclipse workspace which is not available to the stand-alone application. A secondary issue is the problem that SWT has some issues supporting OS mode changes dynamically. See discussion !555 (comment 1104386).

This merge request implements the solution discussed in !555 (comment 1104386).

Addresses #567 (closed)

Merge request reports