Skip to content

Commit

Permalink
Support dark mode
Browse files Browse the repository at this point in the history
  • Loading branch information
A6GibKm committed Aug 5, 2022
1 parent 7f9834c commit 405adc1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
8 changes: 7 additions & 1 deletion piper/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
Expand Down

0 comments on commit 405adc1

Please sign in to comment.