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




commit 6b7c3fe87b5148f66fa66f1113a36ed9e9fe31d0
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 +++-
 meson.build               | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)
---
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):
diff --git a/meson.build b/meson.build
index 1c283dfde..2f32bade8 100644
--- a/meson.build
+++ b/meson.build
@@ -45,7 +45,7 @@ dependency('glib-2.0', version: '>= 2.67.1')
 dependency('goa-1.0', version: '>= 3.35.90')
 dependency('gobject-introspection-1.0', version: '>= 1.35.0')
 dependency('gtk+-3.0', version: '>= 3.24.14')
-dependency('libhandy-1', version: '>= 1.2.0')
+dependency('libhandy-1', version: '>= 1.5.0')
 dependency('libdazzle-1.0', version: '>= 3.28.0')
 dependency('libmediaart-2.0', version: '>= 1.9.1')
 dependency('libsoup-2.4')


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