colorbutton: Fix focus

The colorbutton contains a button which contains a colorswatch.
We want the focus to go straight to the button, nowhere else,
so mark the swatch as !can-focus.

Adapt tests to match.
This commit is contained in:
Matthias Clasen 2020-04-03 17:39:49 -04:00
parent f2d6a7b36a
commit 8991275fbd
2 changed files with 1 additions and 1 deletions

View File

@ -265,6 +265,7 @@ gtk_color_button_init (GtkColorButton *button)
gtk_widget_set_parent (priv->button, GTK_WIDGET (button));
priv->swatch = gtk_color_swatch_new ();
gtk_widget_set_can_focus (priv->swatch, FALSE);
layout = gtk_widget_create_pango_layout (GTK_WIDGET (button), "Black");
pango_layout_get_pixel_extents (layout, NULL, &rect);
g_object_unref (layout);

View File

@ -16,7 +16,6 @@ GtkToggleButton
GtkToggleButton
GtkButton
GtkButton
GtkColorSwatch
GtkButton
GtkLinkButton
GtkSwitch