[file-roller] Align better the buttons in the header bar



commit 8f423258b4af429423ac166416a6171645e4e3d8
Author: Yosef Or Boczko <yoseforb gmail com>
Date:   Sat Dec 21 22:45:56 2013 +0200

    Align better the buttons in the header bar
    
    https://bugzilla.gnome.org/show_bug.cgi?id=720904
    
    Signed-off-by: Yosef Or Boczko <yoseforb gmail com>

 src/fr-window.c |   31 ++++++++++++++++++-------------
 1 files changed, 18 insertions(+), 13 deletions(-)
---
diff --git a/src/fr-window.c b/src/fr-window.c
index 9448122..46a00f7 100644
--- a/src/fr-window.c
+++ b/src/fr-window.c
@@ -5296,8 +5296,10 @@ fr_window_construct (FrWindow *window)
        GtkWidget          *location_box;
        GtkWidget          *filter_box;
        GtkWidget          *tree_scrolled_window;
+       GtkWidget          *button;
        GtkTreeSelection   *selection;
        GtkSizeGroup       *toolbar_size_group;
+       GtkSizeGroup       *header_bar_size_group;
        const char * const *schemas;
 
        /* Create the settings objects */
@@ -5614,29 +5616,30 @@ fr_window_construct (FrWindow *window)
 
        /* header bar buttons */
 
-       gtk_header_bar_pack_start (GTK_HEADER_BAR (window->priv->headerbar),
-                                  _gtk_header_bar_create_text_button (_("Extract"),
-                                                                      NULL,
-                                                                      "win.extract-files"));
-       gtk_header_bar_pack_start (GTK_HEADER_BAR (window->priv->headerbar),
-                                  _gtk_header_bar_create_image_button ("list-add-symbolic",
-                                                                       _("Add Files"),
-                                                                       "win.add-files"));
-       gtk_header_bar_pack_end (GTK_HEADER_BAR (window->priv->headerbar),
-                                _gtk_header_bar_create_image_toggle_button ("edit-find-symbolic",
-                                                                            _("Find files by name"),
-                                                                            "win.find"));
+       header_bar_size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
+
+       button = _gtk_header_bar_create_text_button (_("Extract"), NULL, "win.extract-files");
+       gtk_size_group_add_widget (header_bar_size_group, button);
+       gtk_header_bar_pack_start (GTK_HEADER_BAR (window->priv->headerbar), button);
+
+       button = _gtk_header_bar_create_image_button ("list-add-symbolic", _("Add Files"), "win.add-files");
+       gtk_size_group_add_widget (header_bar_size_group, button);
+       gtk_header_bar_pack_start (GTK_HEADER_BAR (window->priv->headerbar), button);
+
+       button = _gtk_header_bar_create_image_toggle_button ("edit-find-symbolic", _("Find files by name"), 
"win.find");
+       gtk_size_group_add_widget (header_bar_size_group, button);
+       gtk_header_bar_pack_end (GTK_HEADER_BAR (window->priv->headerbar), button);
 
         /* gears menu button */
 
         {
                 GtkBuilder *builder;
                 GMenuModel *menu;
-                GtkWidget  *button;
 
                 builder = _gtk_builder_new_from_resource ("gears-menu.ui");
                 menu = G_MENU_MODEL (gtk_builder_get_object (builder, "menu"));
                 button = _gtk_menu_button_new_for_header_bar ();
+                gtk_size_group_add_widget (header_bar_size_group, button);
                 gtk_container_add (GTK_CONTAINER (button), gtk_image_new_from_icon_name 
("emblem-system-symbolic", GTK_ICON_SIZE_MENU));
                 gtk_menu_button_set_menu_model (GTK_MENU_BUTTON (button), menu);
                 gtk_widget_show_all (button);
@@ -5647,6 +5650,8 @@ fr_window_construct (FrWindow *window)
                 g_object_unref (builder);
         }
 
+        g_object_unref (header_bar_size_group);
+
        /* location bar */
 
        window->priv->location_bar = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 6);


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