[gedit] Remove hardcoded margins



commit 0618e36c863c411f24b705711ae1e501655d50ac
Author: Paolo Borelli <pborelli gnome org>
Date:   Tue Feb 18 13:05:20 2014 +0100

    Remove hardcoded margins

 gedit/gedit-menu-stack-switcher.c |   17 ++++-------------
 gedit/gedit-style.css             |    4 ++++
 2 files changed, 8 insertions(+), 13 deletions(-)
---
diff --git a/gedit/gedit-menu-stack-switcher.c b/gedit/gedit-menu-stack-switcher.c
index 6f2528f..0594c3d 100644
--- a/gedit/gedit-menu-stack-switcher.c
+++ b/gedit/gedit-menu-stack-switcher.c
@@ -50,6 +50,7 @@ gedit_menu_stack_switcher_init (GeditMenuStackSwitcher *switcher)
   GeditMenuStackSwitcherPrivate *priv;
   GtkWidget *box;
   GtkWidget *arrow;
+  GtkStyleContext *context;
 
   priv = gedit_menu_stack_switcher_get_instance_private (switcher);
   switcher->priv = priv;
@@ -68,15 +69,10 @@ gedit_menu_stack_switcher_init (GeditMenuStackSwitcher *switcher)
 
   priv->popover = gtk_popover_new (GTK_WIDGET (switcher));
   gtk_popover_set_position (GTK_POPOVER (priv->popover), GTK_POS_BOTTOM);
+  context = gtk_widget_get_style_context (priv->popover);
+  gtk_style_context_add_class (context, "gedit-stack-switcher");
 
-  priv->button_box = gtk_button_box_new (GTK_ORIENTATION_VERTICAL);
-
-  g_object_set (priv->button_box,
-                "margin-start", 12,
-                "margin-end", 12,
-                "margin-top", 12,
-                "margin-bottom", 12,
-                NULL);
+  priv->button_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 6);
 
   gtk_widget_show (priv->button_box);
 
@@ -175,11 +171,6 @@ add_child (GeditMenuStackSwitcher *switcher,
   gtk_toggle_button_set_mode (GTK_TOGGLE_BUTTON (button), FALSE);
   gtk_widget_set_valign (button, GTK_ALIGN_CENTER);
 
-  g_object_set (button,
-                "margin-top", 3,
-                "margin-bottom", 3,
-                NULL);
-
   update_button (switcher, widget, button);
 
   group = gtk_container_get_children (GTK_CONTAINER (priv->button_box));
diff --git a/gedit/gedit-style.css b/gedit/gedit-style.css
index 0162c3f..5d0770a 100644
--- a/gedit/gedit-style.css
+++ b/gedit/gedit-style.css
@@ -31,3 +31,7 @@
     border-radius: 0;
     border-width: 0 0 0 1px;
 }
+
+.gedit-stack-switcher {
+    padding: 12px;
+}


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