GtkColorSwatch: Respect an explicitly set size

This will let us use a suitably sized color swatch in the color
button.
This commit is contained in:
Matthias Clasen 2014-07-09 20:44:06 -04:00
parent 86cceab75d
commit b68a28fbb0

View File

@ -353,7 +353,14 @@ swatch_get_preferred_width (GtkWidget *widget,
gint *min,
gint *nat)
{
*min = *nat = 48;
gint w, h;
gtk_widget_get_size_request (widget, &w, &h);
if (w < 0)
w = 48;
*min = *nat = w;
}
static void
@ -361,7 +368,14 @@ swatch_get_preferred_height (GtkWidget *widget,
gint *min,
gint *nat)
{
*min = *nat = 32;
gint w, h;
gtk_widget_get_size_request (widget, &w, &h);
if (h < 0)
h = 32;
*min = *nat = h;
}
static gboolean