diff --git a/meson.build b/meson.build index 21963d8a..d8d88e22 100644 --- a/meson.build +++ b/meson.build @@ -54,6 +54,7 @@ if enable_runtime_dependency_checks ] dependency('pygobject-3.0', required: true) + dependency('libhandy-1', version: '>= 1.6') else # external python modules that are required for building piper python_modules = ['lxml'] diff --git a/piper/application.py b/piper/application.py index d02dc544..9b5d052b 100644 --- a/piper/application.py +++ b/piper/application.py @@ -6,7 +6,8 @@ import gi gi.require_version("Gio", "2.0") gi.require_version("Gtk", "3.0") -from gi.repository import Gio, GLib, Gtk # noqa +gi.require_version("Handy", "1") +from gi.repository import Gio, GLib, Gtk, Handy # noqa class Application(Gtk.Application): @@ -27,9 +28,14 @@ def do_startup(self): initialization should be done here, to prevent doing duplicate work in case another window is opened.""" Gtk.Application.do_startup(self) + Handy.init() self._build_app_menu() self._ratbagd = None + # Opt-in to follow the system color-scheme. + manager = Handy.StyleManager.get_default() + manager.set_color_scheme(Handy.ColorScheme.PREFER_LIGHT) + def init_ratbagd(self): if self._ratbagd is None: self._ratbag = Ratbagd(self._required_ratbagd_version)