mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-10 03:47:44 -03:00
Update native_theme_gtk.cc
This commit is contained in:
parent
d5fe7f8e00
commit
29e1d91afc
1 changed files with 3 additions and 1 deletions
|
@ -209,7 +209,8 @@ void NativeThemeGtk::OnThemeChanged(GtkSettings* settings,
|
|||
SetPreferredContrast(
|
||||
high_contrast ? ui::NativeThemeBase::PreferredContrast::kMore
|
||||
: ui::NativeThemeBase::PreferredContrast::kNoPreference);
|
||||
|
||||
|
||||
if (base::CommandLine::ForCurrentProcess()->HasSwitch("auto-dark-mode")) {
|
||||
// Brute force NativeUI to update
|
||||
ui::NativeTheme::GetInstanceForNativeUi()->set_use_dark_colors(color_utils::IsDark(window_bg_color));
|
||||
ui::NativeTheme::GetInstanceForNativeUi()->set_preferred_color_scheme(CalculatePreferredColorScheme());
|
||||
|
@ -219,6 +220,7 @@ void NativeThemeGtk::OnThemeChanged(GtkSettings* settings,
|
|||
ui::NativeTheme::GetInstanceForWeb()->set_use_dark_colors(color_utils::IsDark(window_bg_color));
|
||||
ui::NativeTheme::GetInstanceForWeb()->set_preferred_color_scheme(CalculatePreferredColorScheme());
|
||||
ui::NativeTheme::GetInstanceForWeb()->NotifyOnNativeThemeUpdated();
|
||||
}
|
||||
|
||||
NotifyOnNativeThemeUpdated();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue