[gtk+/wip/entry-css-cleanups: 5/11] entry: always add padding to the allocation



commit ecb02a2a561cd59f27f937552cd209eb49b9dc02
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Mon Jan 30 15:23:26 2012 -0500

    entry: always add padding to the allocation
    
    Even when we don't have a frame. We just ignore the borders in this
    case.

 gtk/gtkentry.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 5c1668b..2c8823b 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3029,15 +3029,15 @@ _gtk_entry_get_borders (GtkEntry *entry,
   GtkEntryPrivate *priv = entry->priv;
   GtkWidget *widget = GTK_WIDGET (entry);
   GtkBorder tmp = { 0, 0, 0, 0 };
+  GtkStyleContext *context;
+
+  context = gtk_widget_get_style_context (widget);
+  gtk_style_context_get_padding (context, 0, &tmp);
 
   if (priv->has_frame)
     {
-      GtkStyleContext *context;
       GtkBorder border;
 
-      context = gtk_widget_get_style_context (widget);
-      gtk_style_context_get_padding (context, 0, &tmp);
-
       gtk_style_context_get_border (context, 0, &border);
       tmp.top += border.top;
       tmp.right += border.right;



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