[shotwell/wip/phako/move-gsettings-prefix: 20/20] Move initialization of theme



commit 87878fdcf231d575f0c0f844a2fb4c2971e0b89d
Author: Jens Georg <mail jensge org>
Date:   Mon Jan 6 21:49:11 2020 +0100

    Move initialization of theme
    
    For library, do it after the database verification, which will trigger
    the database upgrade which might trigger gsettings migration

 src/main.vala | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/main.vala b/src/main.vala
index 78611ca6..779234b6 100644
--- a/src/main.vala
+++ b/src/main.vala
@@ -72,6 +72,10 @@ void library_exec(string[] mounts) {
                 result.to_string());
         break;
     }
+
+    // Need to set this before anything else, but _after_ setting the profile
+    var use_dark = Config.Facade.get_instance().get_gtk_theme_variant();
+    Gtk.Settings.get_default().gtk_application_prefer_dark_theme = use_dark;
     
     if (errormsg != null) {
         Gtk.MessageDialog dialog = new Gtk.MessageDialog(null, Gtk.DialogFlags.MODAL, 
@@ -287,7 +291,11 @@ void editing_exec(string filename, bool fullscreen) {
     // preconfigure units
     Direct.preconfigure(initial_file);
     Db.preconfigure(null);
-    
+
+    // Need to set this before anything else, but _after_ setting the profile
+    var use_dark = Config.Facade.get_instance().get_gtk_theme_variant();
+    Gtk.Settings.get_default().gtk_application_prefer_dark_theme = use_dark;
+
     // initialize units for direct-edit mode
     try {
         Direct.app_init();
@@ -391,10 +399,6 @@ void main(string[] args) {
         CommandlineOptions.data_dir = manager.derive_data_dir(CommandlineOptions.data_dir);
     }
 
-    // Need to set this before anything else, but _after_ setting the profile
-    var use_dark = Config.Facade.get_instance().get_gtk_theme_variant();
-    Gtk.Settings.get_default().gtk_application_prefer_dark_theme = use_dark;
-
     if (CommandlineOptions.show_version) {
         if (Resources.GIT_VERSION != "")
             print("%s %s (%s)\n", Resources.APP_TITLE, Resources.APP_VERSION, Resources.GIT_VERSION);


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