[gnome-system-monitor/wip/cdavis/dark-style-preference: 3/5] application: Opt in to libhandy dark style pref




commit aeb252f2ac93f2f341ea8faf8af0ce18f251cc11
Author: Christopher Davis <christopherdavis gnome org>
Date:   Wed Dec 1 15:23:41 2021 -0800

    application: Opt in to libhandy dark style pref
    
    GNOME 42 will have support for a global dark style
    preference. For GTK3+libhandy applications we need
    to opt in to following the preference.
    
    See https://gitlab.gnome.org/GNOME/Initiatives/-/issues/32

 meson.build         | 2 +-
 src/application.cpp | 5 +++++
 2 files changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/meson.build b/meson.build
index 9ddba2bd..8447800a 100644
--- a/meson.build
+++ b/meson.build
@@ -48,7 +48,7 @@ gtk3    = dependency('gtk+-3.0',    version: '>=3.22.0')
 gtkmm   = dependency('gtkmm-3.0',   version: '>=3.3.18')
 atkmm   = dependency('atkmm-1.6',   version: '>=2.28')
 libgtop = dependency('libgtop-2.0', version: '>=2.37.0')
-libhandy = dependency('libhandy-1',  version: '>=1.0.0')
+libhandy = dependency('libhandy-1',  version: '>=1.5.0')
 librsvg = dependency('librsvg-2.0', version: '>=2.35')
 libxml  = dependency('libxml-2.0',  version: '>=2.0')
 
diff --git a/src/application.cpp b/src/application.cpp
index e66408a1..440f03ea 100644
--- a/src/application.cpp
+++ b/src/application.cpp
@@ -470,12 +470,17 @@ GsmApplication::shutdown()
 
 void GsmApplication::on_startup()
 {
+    HdyStyleManager *style_manager;
+
     Gtk::Application::on_startup();
 
     hdy_init();
 
     load_resources ();
 
+    style_manager = hdy_style_manager_get_default ();
+    hdy_style_manager_set_color_scheme (style_manager, HDY_COLOR_SCHEME_PREFER_LIGHT);
+
     Glib::RefPtr<Gio::SimpleAction> action;
 
     action = Gio::SimpleAction::create("quit");


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]