[geary] Remove unnecessary space in icon-only toolbar btns: Closes bgo#713837



commit a70d47a543a8f46a86237e4ba0cc53aabf973f5e
Author: Yosef Or Boczko <yoseforb src gnome org>
Date:   Mon Feb 3 13:45:32 2014 -0800

    Remove unnecessary space in icon-only toolbar btns: Closes bgo#713837

 src/client/components/pill-toolbar.vala |   31 ++-----------------------------
 1 files changed, 2 insertions(+), 29 deletions(-)
---
diff --git a/src/client/components/pill-toolbar.vala b/src/client/components/pill-toolbar.vala
index 6cb41b0..ac86bb4 100644
--- a/src/client/components/pill-toolbar.vala
+++ b/src/client/components/pill-toolbar.vala
@@ -21,10 +21,9 @@ public class PillToolbar : Gtk.Toolbar {
         b.image = new Gtk.Image.from_icon_name(icon_name != null ? icon_name :
             b.related_action.icon_name, Gtk.IconSize.MENU);
         b.always_show_image = true;
-        b.image.margin = get_icon_margin();
         
         if (!show_label)
-            b.label = "";
+            b.label = null;
         
         if (show_label && !Geary.String.is_empty(b.related_action.label))
             if (b.get_direction() == Gtk.TextDirection.RTL)
@@ -78,21 +77,8 @@ public class PillToolbar : Gtk.Toolbar {
             box.get_style_context().add_class(Gtk.STYLE_CLASS_LINKED);
         }
         
-        int i = 0;
-        foreach(Gtk.Button button in buttons) {
+        foreach(Gtk.Button button in buttons)
             box.add(button);
-            
-            // Place the right spacer on the button itself.  This way if the button is not displayed,
-            // the spacer will not appear.
-            if (i == buttons.size - 1 && after_spacer) {
-                if (button.get_direction() == Gtk.TextDirection.RTL)
-                    button.set_margin_left(12);
-                else
-                    button.set_margin_right(12);
-            }
-            
-            i++;
-        }
         
         Gtk.ToolItem tool_item = new Gtk.ToolItem();
         tool_item.add(box);
@@ -108,19 +94,6 @@ public class PillToolbar : Gtk.Toolbar {
     }
     
     /**
-     * Computes the margin for each icon (shamelessly stolen from Nautilus.)
-     */
-    public int get_icon_margin() {
-        Gtk.IconSize toolbar_size = get_icon_size();
-        int toolbar_size_px, menu_size_px;
-        
-        Gtk.icon_size_lookup(Gtk.IconSize.MENU, out menu_size_px, null);
-        Gtk.icon_size_lookup(toolbar_size, out toolbar_size_px, null);
-        
-        return Geary.Numeric.int_floor((int) ((toolbar_size_px - menu_size_px) / 2.0), 0);
-    }
-    
-    /**
      * Returns an expandable spacer item.
      */
     public Gtk.ToolItem create_spacer() {


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