label: use GtkMisc padding again

this was lost in the gadget conversion in a81267c28e

https://bugzilla.gnome.org/show_bug.cgi?id=760522
This commit is contained in:
Christoph Reiter 2016-01-28 11:04:48 +01:00
parent 79fb921ffc
commit 27263f2387

View File

@ -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;
}
}