[gnome-music/wip/cdavis/dark-style-opt-in: 2/5] application: Opt in to libhandy dark style
- From: Marinus Schraal <mschraal src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/cdavis/dark-style-opt-in: 2/5] application: Opt in to libhandy dark style
- Date: Fri, 4 Feb 2022 07:10:33 +0000 (UTC)
commit 31461b860243a5e38825377ee727c07c65f74025
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 b5dff88dd..341e8e1d5 100644
--- a/gnomemusic/application.py
+++ b/gnomemusic/application.py
@@ -33,7 +33,7 @@
from typing import Optional
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
@@ -234,6 +234,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 9bcb6c1fb..6c0db1a3e 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]