[gtk+] label: use GtkMisc padding again



commit 27263f2387b414707d33862335b7e35b0cf722c3
Author: Christoph Reiter <creiter src gnome org>
Date:   Thu Jan 28 11:04:48 2016 +0100

    label: use GtkMisc padding again
    
    this was lost in the gadget conversion in a81267c28e4e0368cd0e23b661e1c8c53f8194fb
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760522

 gtk/gtklabel.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index a1bbb05..ce9d9a1 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -3767,9 +3767,14 @@ gtk_label_get_preferred_size (GtkWidget      *widget,
 {
   GtkLabel      *label = GTK_LABEL (widget);
   GtkLabelPrivate  *priv = label->priv;
+  gint xpad, ypad;
   PangoRectangle widest_rect;
   PangoRectangle smallest_rect;
 
+  G_GNUC_BEGIN_IGNORE_DEPRECATIONS
+    gtk_misc_get_padding (GTK_MISC (label), &xpad, &ypad);
+  G_GNUC_END_IGNORE_DEPRECATIONS
+
   if (minimum_baseline)
     *minimum_baseline = -1;
 
@@ -3837,6 +3842,9 @@ gtk_label_get_preferred_size (GtkWidget      *widget,
           *minimum_size = smallest_rect.width;
           *natural_size = widest_rect.width;
         }
+
+      *minimum_size += xpad * 2;
+      *natural_size += xpad * 2;
     }
   else /* GTK_ORIENTATION_VERTICAL */
     {
@@ -3870,6 +3878,9 @@ gtk_label_get_preferred_size (GtkWidget      *widget,
           *minimum_size = MIN (smallest_rect.height, widest_rect.height);
           *natural_size = MAX (smallest_rect.height, widest_rect.height);
         }
+
+      *minimum_size += ypad * 2;
+      *natural_size += ypad * 2;
     }
 }
 


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