[gnome-boxes/allow-theme-override-in-gsetting: 24/24] app-window: Allow theme override in gsetting




commit 2930e40e051abd888af92508790b14ebbd50cc0a
Author: Felipe Borges <felipeborges gnome org>
Date:   Thu Oct 8 16:42:19 2020 +0200

    app-window: Allow theme override in gsetting
    
    Fixes #607

 data/org.gnome.boxes.gschema.xml | 7 +++++++
 src/app-window.vala              | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/data/org.gnome.boxes.gschema.xml b/data/org.gnome.boxes.gschema.xml
index e3b0d317..2cc1c570 100644
--- a/data/org.gnome.boxes.gschema.xml
+++ b/data/org.gnome.boxes.gschema.xml
@@ -47,6 +47,13 @@
         Whether Boxes is running for the first time
       </description>
     </key>
+    <key name="override-theme" type="b">
+      <default>true</default>
+      <summary>Override theme</summary>
+      <description>
+        Whether Boxes will override the user's theme
+      </description>
+    </key>
 
     <key name="shared-folders" type="s">
       <default>""</default>
diff --git a/src/app-window.vala b/src/app-window.vala
index caba3b13..0e5670e2 100644
--- a/src/app-window.vala
+++ b/src/app-window.vala
@@ -140,7 +140,8 @@ public AppWindow (Gtk.Application app) {
         notify["ui-state"].connect (ui_state_changed);
 
         Gtk.Window.set_default_icon_name (Config.APPLICATION_ID);
-        Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = true;
+        var override_theme = settings.get_boolean ("override-theme");
+        Gtk.Settings.get_default ().gtk_application_prefer_dark_theme = override_theme;
 
         var provider = Boxes.load_css ("gtk-style.css");
         Gtk.StyleContext.add_provider_for_screen (Gdk.Screen.get_default (),


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