Bug 548960 - Enable operating system dark mode in swt browser
Summary: Enable operating system dark mode in swt browser
Status: NEW
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.13   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Platform-SWT-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: triaged
Depends on:
Blocks: 577357
  Show dependency tree
 
Reported: 2019-07-04 03:34 EDT by Matthias Becker CLA
Modified: 2022-01-18 09:19 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Matthias Becker CLA 2019-07-04 03:34:01 EDT
In https://bugs.eclipse.org/bugs/show_bug.cgi?id=532185 we enhanced the eclipse help system and the help documents so that the prefers-color-scheme media query (see https://drafts.csswg.org/mediaqueries-5/#prefers-color-scheme ) is used there.
With this the help is displayed in dark mode when the OS-level settings are set to "dark mode".

When the help is displayed in the integrated help view the SWT browser widget is used.
In this case the OS-level (or even eclipse "appearance" preferences") don't have an effect on that.

Can this be changed so that the embedded browser also considers these settings?
Comment 1 Eric Williams CLA 2019-08-13 09:21:52 EDT
Do you have an example snippet or use case that shows this bug? I.e. some place where the browser isn't properly themed because of this bug?
Comment 2 Andrew Johnson CLA 2020-10-02 05:13:03 EDT
This causes a problem for Eclipse Memory Analyzer.
The tool builds HTML reports which it displays using the SWT browser.
On Windows the SWT internal browser does not handle the CSS:

@media screen and (prefers-color-scheme: dark) {

nor does it handle:

img {
  filter: invert(100%) hue-rotate(180deg);
}

The first is useful to automatically change the style sheet.
The second is a neat way of fixing coloured charts - white goes to black, black to white, and with the hue rotate dark blue goes to light blue and vice versa etc., so charts look normal.

I can work around the first by copying a different style sheet when in dark mode.
I don't think I can fix the second without having new image files.

See bug 567533
Comment 3 Andrew Johnson CLA 2020-10-05 04:53:32 EDT
I think this is a Windows problem with the internal "ie" browser as it works for Memory Analyzer based off 2020-03 running on Ubuntu (via Docker). 

If this is confirmed we could update the Hardware fields for this bug.