[glade] Bug 536840 - Save palette small icon preference



commit 276a16f4bd02a3293d07326c61c63058b2adb96d
Author: Tristan Van Berkom <tristan vanberkom codethink co uk>
Date:   Fri Jan 29 18:09:21 2016 +0100

    Bug 536840 - Save palette small icon preference

 src/glade-window.c |   17 ++++++++++++++++-
 1 files changed, 16 insertions(+), 1 deletions(-)
---
diff --git a/src/glade-window.c b/src/glade-window.c
index 0f02b3e..64924a1 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -71,6 +71,7 @@
 #define CONFIG_KEY_SHOW_STATUS      "show-statusbar"
 #define CONFIG_KEY_EDITOR_HEADER    "show-editor-header"
 #define CONFIG_KEY_PALETTE          "palette-appearance"
+#define CONFIG_KEY_PALETTE_SMALL    "palette-small-icons"
 
 #define CONFIG_GROUP_LOAD_SAVE      "Load and Save"
 #define CONFIG_KEY_BACKUP           "backup"
@@ -2854,6 +2855,9 @@ save_windows_config (GladeWindow *window, GKeyFile *config)
 
   g_key_file_set_integer (config, CONFIG_GROUP_WINDOWS, CONFIG_KEY_PALETTE,
                           gtk_radio_action_get_current_value (GTK_RADIO_ACTION 
(priv->icons_and_labels_radioaction)));
+
+  g_key_file_set_boolean (config, CONFIG_GROUP_WINDOWS, CONFIG_KEY_PALETTE_SMALL,
+                          gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (priv->use_small_icons_action)));
 }
 
 static void
@@ -3002,7 +3006,7 @@ static void
 glade_window_config_load (GladeWindow *window)
 {
   GKeyFile *config = glade_app_get_config ();
-  gboolean show_toolbar, show_tabs, show_status, show_header;
+  gboolean show_toolbar, show_tabs, show_status, show_header, small_icons;
   gint palette_appearance;
   GladeWindowPrivate *priv = window->priv;
   GError *error = NULL;
@@ -3056,6 +3060,15 @@ glade_window_config_load (GladeWindow *window)
       error = (g_error_free (error), NULL);
     }
 
+  if ((small_icons =
+       g_key_file_get_boolean (config, CONFIG_GROUP_WINDOWS,
+                               CONFIG_KEY_PALETTE_SMALL, &error)) == FALSE &&
+      error != NULL)
+    {
+      small_icons = FALSE;
+      error = (g_error_free (error), NULL);
+    }
+
   if (show_toolbar)
     gtk_widget_show (priv->toolbar);
   else
@@ -3079,6 +3092,8 @@ glade_window_config_load (GladeWindow *window)
 
   gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (priv->editor_header_visible_action), show_header);
 
+  gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (priv->use_small_icons_action), small_icons);
+
   gtk_radio_action_set_current_value (GTK_RADIO_ACTION (priv->icons_and_labels_radioaction), 
palette_appearance);
 
   /* Paned positions */


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