[gitg/system-dark-settings] Honor system preferences about using dark theme




commit a24eb199b829d0c216e7f41a4f5da766f79d3a42
Author: Alberto Fanjul <albertofanjul gmail com>
Date:   Sun Aug 28 18:35:54 2022 +0200

    Honor system preferences about using dark theme

 gitg/gitg-application.vala | 4 ++++
 gitg/meson.build           | 1 +
 meson.build                | 1 +
 3 files changed, 6 insertions(+)
---
diff --git a/gitg/gitg-application.vala b/gitg/gitg-application.vala
index d2930360..92f6ddae 100644
--- a/gitg/gitg-application.vala
+++ b/gitg/gitg-application.vala
@@ -78,6 +78,10 @@ public class Application : Gtk.Application
        static construct
        {
                activity = "";
+               Hdy.init ();
+
+               var style_manager = Hdy.StyleManager.get_default();
+               style_manager.color_scheme = Hdy.ColorScheme.PREFER_LIGHT;
        }
 
        private static bool show_version_and_quit()
diff --git a/gitg/meson.build b/gitg/meson.build
index ad551c6f..4b108a14 100644
--- a/gitg/meson.build
+++ b/gitg/meson.build
@@ -64,6 +64,7 @@ sources = gitg_sources + files(
 
 deps = [
   config_dep,
+  hdy_dep,
   gitg_platform_support_dep,
   gobject_introspection_dep,
   gtksourceview_dep,
diff --git a/meson.build b/meson.build
index 75442e51..067da7dd 100644
--- a/meson.build
+++ b/meson.build
@@ -122,6 +122,7 @@ common_ldflags = cc.get_supported_link_arguments('-Wl,--version-script,@0@'.form
 
 glib_req_version = '>= 2.68'
 
+hdy_dep = dependency ('libhandy-1', version: '>= 1.5.0')
 gee_dep = dependency('gee-0.8')
 gio_dep = dependency('gio-2.0', version: glib_req_version)
 glib_dep = dependency('glib-2.0', version: glib_req_version)


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