feat: enable dark mode on GTK UIs (#38977)
feat: port DarkModeManagerLinux This is needed after https://bugs.chromium.org/p/chromium/issues/detail?id=998903 and replaces the previous workaround to detect dark mode on GTK. Detect system dark theme preference via xdg settings portal: https://flatpak.github.io/xdg-desktop-portal/#gdbus-org.freedesktop.portal.Settings Closes: https://github.com/electron/electron/issues/38961 Closes: https://github.com/electron/electron/issues/28838 Signed-off-by: Robert Günzler <r@gnzler.io> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
parent
a0ae691a9c
commit
480f48b2fc
3 changed files with 12 additions and 48 deletions
|
@ -43,7 +43,8 @@ class Environment;
|
|||
|
||||
namespace ui {
|
||||
class LinuxUiGetter;
|
||||
}
|
||||
class DarkModeManagerLinux;
|
||||
} // namespace ui
|
||||
|
||||
namespace electron {
|
||||
|
||||
|
@ -65,10 +66,6 @@ class ViewsDelegate;
|
|||
class ViewsDelegateMac;
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
class DarkThemeObserver;
|
||||
#endif
|
||||
|
||||
class ElectronBrowserMainParts : public content::BrowserMainParts {
|
||||
public:
|
||||
ElectronBrowserMainParts();
|
||||
|
@ -145,9 +142,7 @@ class ElectronBrowserMainParts : public content::BrowserMainParts {
|
|||
#endif
|
||||
|
||||
#if BUILDFLAG(IS_LINUX)
|
||||
// Used to notify the native theme of changes to dark mode.
|
||||
std::unique_ptr<DarkThemeObserver> dark_theme_observer_;
|
||||
|
||||
std::unique_ptr<ui::DarkModeManagerLinux> dark_mode_manager_;
|
||||
std::unique_ptr<ui::LinuxUiGetter> linux_ui_getter_;
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue