[gnome-music/wip/cdavis/dark-style-opt-in] application: Opt in to libhandy dark style




commit 146e094ab74f792598ddc306637462d3e77aaf22
Author: Christopher Davis <christopherdavis gnome org>
Date:   Sat Sep 25 18:58:56 2021 -0700

    application: Opt in to libhandy dark style
    
    GNOME is getting support for a global dark style preference
    in GNOME 42. For GTK3 apps we can use libhandy to opt
    in to using this preference.

 gnomemusic/application.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/application.py b/gnomemusic/application.py
index c92a6aa1e..17ac06b46 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -32,7 +32,7 @@
 
 from gettext import gettext as _
 
-from gi.repository import Gtk, Gio, GLib, Gdk, GObject
+from gi.repository import Gtk, Gio, GLib, Gdk, GObject, Handy
 
 from gnomemusic.coregrilo import CoreGrilo
 from gnomemusic.coremodel import CoreModel
@@ -220,6 +220,8 @@ class Application(Gtk.Application):
 
     def do_startup(self):
         Gtk.Application.do_startup(self)
+        Handy.StyleManager.get_default().set_color_scheme(
+            Handy.ColorScheme.PREFER_LIGHT)
         self._set_actions()
 
     def _quit(self, action=None, param=None):


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