[glade/modern-ui: 2/34] GladeWindow: remove palette related actions from view menu



commit a69138d1de8103fa5a3a78b1ef9c8e207ee632f8
Author: Juan Pablo Ugarte <juanpablougarte gmail com>
Date:   Sat Jun 10 19:28:31 2017 -0300

    GladeWindow: remove palette related actions from view menu

 src/glade-window.c |   80 +----------------------------------------------
 src/glade.glade    |   89 +---------------------------------------------------
 2 files changed, 2 insertions(+), 167 deletions(-)
---
diff --git a/src/glade-window.c b/src/glade-window.c
index 625e1ac..9788875 100644
--- a/src/glade-window.c
+++ b/src/glade-window.c
@@ -69,8 +69,6 @@
 #define CONFIG_KEY_SHOW_TABS        "show-tabs"
 #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"
@@ -105,7 +103,6 @@ struct _GladeWindowPrivate
   GtkAction *save_action, *quit_action;
   GtkAction *undo_action, *redo_action, *cut_action, *copy_action, *paste_action, *delete_action;
   GtkAction *previous_project_action, *next_project_action;
-  GtkAction *use_small_icons_action, *icons_and_labels_radioaction;
   GtkAction *toolbar_visible_action, *project_tabs_visible_action, *statusbar_visible_action, 
*editor_header_visible_action;
   GtkAction *selector_radioaction;
 
@@ -1793,7 +1790,6 @@ on_notebook_tab_added (GtkNotebook *notebook,
                        guint page_num,
                        GladeWindow *window)
 {
-  GladeWindowPrivate *priv = window->priv;
   GladeProject *project;
   GtkWidget *inspector, *palette;
 
@@ -1832,12 +1828,6 @@ on_notebook_tab_added (GtkNotebook *notebook,
   glade_palette_set_show_selector_button (GLADE_PALETTE (palette), FALSE);
   glade_palette_set_project (GLADE_PALETTE (palette), project);
 
-  glade_palette_set_use_small_item_icons (GLADE_PALETTE (palette),
-                                         gtk_toggle_action_get_active (GTK_TOGGLE_ACTION 
(priv->use_small_icons_action)));
-
-  glade_palette_set_item_appearance (GLADE_PALETTE (palette),
-                                    gtk_radio_action_get_current_value (GTK_RADIO_ACTION 
(priv->icons_and_labels_radioaction)));
-
   gtk_notebook_append_page (window->priv->palettes_notebook, palette, NULL);
   
   if (GPOINTER_TO_INT
@@ -1940,41 +1930,6 @@ on_open_recent_action_item_activated (GtkRecentChooser *chooser,
 }
 
 static void
-on_palette_appearance_radioaction_changed (GtkRadioAction *action,
-                                           GtkRadioAction *current,
-                                           GladeWindow    *window)
-{
-  GList *children, *l;
-  gint value;
-
-  value = gtk_radio_action_get_current_value (current);
-
-  children = gtk_container_get_children (GTK_CONTAINER (window->priv->palettes_notebook));
-  for (l = children; l; l = l->next)
-    {
-      if (GLADE_IS_PALETTE (l->data))
-        glade_palette_set_item_appearance (GLADE_PALETTE (l->data), value);
-    }
-  g_list_free (children);
-}
-
-static void
-on_use_small_icons_action_toggled (GtkAction *action, GladeWindow *window)
-{
-  GList *children, *l;
-
-  children = gtk_container_get_children (GTK_CONTAINER (window->priv->palettes_notebook));
-  for (l = children; l; l = l->next)
-    {
-      if (GLADE_IS_PALETTE (l->data))
-       glade_palette_set_use_small_item_icons (GLADE_PALETTE (l->data),
-                                               gtk_toggle_action_get_active
-                                               (GTK_TOGGLE_ACTION (action)));
-    }
-  g_list_free (children);
-}
-
-static void
 on_toolbar_visible_action_toggled (GtkAction *action, GladeWindow *window)
 {
   if (gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)))
@@ -2666,12 +2621,6 @@ save_windows_config (GladeWindow *window, GKeyFile *config)
 
   g_key_file_set_boolean (config, CONFIG_GROUP_WINDOWS, CONFIG_KEY_EDITOR_HEADER,
                           gtk_toggle_action_get_active (GTK_TOGGLE_ACTION 
(priv->editor_header_visible_action)));
-
-  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
@@ -2807,8 +2756,7 @@ static void
 glade_window_config_load (GladeWindow *window)
 {
   GKeyFile *config = glade_app_get_config ();
-  gboolean show_toolbar, show_tabs, show_status, show_header, small_icons;
-  gint palette_appearance;
+  gboolean show_toolbar, show_tabs, show_status, show_header;
   GladeWindowPrivate *priv = window->priv;
   GError *error = NULL;
 
@@ -2852,24 +2800,6 @@ glade_window_config_load (GladeWindow *window)
       error = (g_error_free (error), NULL);
     }
 
-  if ((palette_appearance =
-       g_key_file_get_integer (config, CONFIG_GROUP_WINDOWS,
-                               CONFIG_KEY_PALETTE, &error)) == 0 &&
-      error != NULL)
-    {
-      palette_appearance = 1; /* Default to icons */
-      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
@@ -2893,10 +2823,6 @@ 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 */
   load_paned_position (config, window->priv->left_paned, "left_pane", 200);
   load_paned_position (config, window->priv->center_paned, "center_pane", 400);
@@ -3152,8 +3078,6 @@ glade_window_class_init (GladeWindowClass *klass)
   gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, delete_action);
   gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, previous_project_action);
   gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, next_project_action);
-  gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, use_small_icons_action);
-  gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, icons_and_labels_radioaction);
   gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, toolbar_visible_action);
   gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, project_tabs_visible_action);
   gtk_widget_class_bind_template_child_private (widget_class, GladeWindow, statusbar_visible_action);
@@ -3179,12 +3103,10 @@ glade_window_class_init (GladeWindowClass *klass)
   gtk_widget_class_bind_template_callback (widget_class, on_registration_action_activate);
 
   gtk_widget_class_bind_template_callback (widget_class, on_open_recent_action_item_activated);
-  gtk_widget_class_bind_template_callback (widget_class, on_use_small_icons_action_toggled);
   gtk_widget_class_bind_template_callback (widget_class, on_toolbar_visible_action_toggled);
   gtk_widget_class_bind_template_callback (widget_class, on_statusbar_visible_action_toggled);
   gtk_widget_class_bind_template_callback (widget_class, on_project_tabs_visible_action_toggled);
   gtk_widget_class_bind_template_callback (widget_class, on_editor_header_visible_action_toggled);
-  gtk_widget_class_bind_template_callback (widget_class, on_palette_appearance_radioaction_changed);
   gtk_widget_class_bind_template_callback (widget_class, on_selector_radioaction_changed);
   gtk_widget_class_bind_template_callback (widget_class, on_actiongroup_connect_proxy);
   gtk_widget_class_bind_template_callback (widget_class, on_actiongroup_disconnect_proxy);
diff --git a/src/glade.glade b/src/glade.glade
index b7c7b61..d0b4650 100644
--- a/src/glade.glade
+++ b/src/glade.glade
@@ -265,13 +265,6 @@ Andreas Nilsson &lt;andreas andreasn se&gt;</property>
     <signal name="connect-proxy" handler="on_actiongroup_connect_proxy" swapped="no"/>
     <signal name="disconnect-proxy" handler="on_actiongroup_disconnect_proxy" swapped="no"/>
     <child>
-      <object class="GtkToggleAction" id="use_small_icons_action">
-        <property name="label" translatable="yes">_Use Small Icons</property>
-        <property name="tooltip" translatable="yes">Show items using small icons</property>
-        <signal name="toggled" handler="on_use_small_icons_action_toggled" swapped="no"/>
-      </object>
-    </child>
-    <child>
       <object class="GtkToggleAction" id="statusbar_visible_action">
         <property name="label" translatable="yes">_Statusbar</property>
         <property name="tooltip" translatable="yes">Show the statusbar</property>
@@ -296,33 +289,6 @@ Andreas Nilsson &lt;andreas andreasn se&gt;</property>
       </object>
     </child>
     <child>
-      <object class="GtkRadioAction" id="icons_and_labels_radioaction">
-        <property name="label" translatable="yes">Text _beside icons</property>
-        <property name="tooltip" translatable="yes">Display items as text beside icons</property>
-        <property name="draw_as_radio">True</property>
-        <property name="group">icons_only_radioaction</property>
-        <signal name="changed" handler="on_palette_appearance_radioaction_changed" swapped="no"/>
-      </object>
-    </child>
-    <child>
-      <object class="GtkRadioAction" id="icons_only_radioaction">
-        <property name="label" translatable="yes">_Icons only</property>
-        <property name="tooltip" translatable="yes">Display items as icons only</property>
-        <property name="draw_as_radio">True</property>
-        <property name="active">True</property>
-        <property name="value">1</property>
-      </object>
-    </child>
-    <child>
-      <object class="GtkRadioAction" id="labels_only_radioaction">
-        <property name="label" translatable="yes">_Text only</property>
-        <property name="tooltip" translatable="yes">Display items as text only</property>
-        <property name="draw_as_radio">True</property>
-        <property name="value">2</property>
-        <property name="group">icons_only_radioaction</property>
-      </object>
-    </child>
-    <child>
       <object class="GtkToggleAction" id="editor_header_visible_action">
         <property name="label" translatable="yes">_Editor Header</property>
         <property name="tooltip" translatable="yes">Show the header in the property editor</property>
@@ -692,59 +658,6 @@ Andreas Nilsson &lt;andreas andreasn se&gt;</property>
                         <property name="can_focus">False</property>
                       </object>
                     </child>
-                    <child>
-                      <object class="GtkMenuItem" id="imagemenuitem23">
-                        <property name="visible">True</property>
-                        <property name="can_focus">False</property>
-                        <property name="label" translatable="yes">Palette _Appearance</property>
-                        <property name="use_underline">True</property>
-                        <child type="submenu">
-                          <object class="GtkMenu" id="menu6">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <child>
-                              <object class="GtkCheckMenuItem" id="icons_and_labels_checkmenuitem">
-                                <property name="use_action_appearance">True</property>
-                                <property name="related_action">icons_and_labels_radioaction</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkCheckMenuItem" id="icons_only_checkmenuitem">
-                                <property name="use_action_appearance">True</property>
-                                <property name="related_action">icons_only_radioaction</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkCheckMenuItem" id="labels_only_checkmenuitem">
-                                <property name="use_action_appearance">True</property>
-                                <property name="related_action">labels_only_radioaction</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkSeparatorMenuItem" id="separatormenuitem7">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                              </object>
-                            </child>
-                            <child>
-                              <object class="GtkCheckMenuItem" id="use_small_icons_menuitem">
-                                <property name="use_action_appearance">True</property>
-                                <property name="related_action">use_small_icons_action</property>
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="use_underline">True</property>
-                              </object>
-                            </child>
-                          </object>
-                        </child>
-                      </object>
-                    </child>
                   </object>
                 </child>
               </object>
@@ -1169,7 +1082,7 @@ Andreas Nilsson &lt;andreas andreasn se&gt;</property>
         </child>
       </object>
     </child>
-    <child>
+    <child type="titlebar">
       <placeholder/>
     </child>
   </template>


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