mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-18 09:00:34 +00:00
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:
parent
86cceab75d
commit
b68a28fbb0
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user