summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2020-03-17 21:48:45 -0400
committerMatthias Clasen <mclasen@redhat.com>2020-03-17 21:49:29 -0400
commit3408ff1dd7b0713b0172eedd15ff38147198e84e (patch)
tree74a91b1c1c36e43b796618e4772eeb8fdf76fe3e
parent7a46157edf31ddb2c4b6ad3db1b4261d7473d807 (diff)
downloadgtk+-3408ff1dd7b0713b0172eedd15ff38147198e84e.tar.gz
emojichooser: Fix keynav
Make arrow and tab keys work in the variations popover again.
-rw-r--r--gtk/gtkemojichooser.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c
index 121b1b697f..66594db645 100644
--- a/gtk/gtkemojichooser.c
+++ b/gtk/gtkemojichooser.c
@@ -104,11 +104,27 @@ gtk_emoji_chooser_child_size_allocate (GtkWidget *widget,
gtk_native_check_resize (GTK_NATIVE (child->variations));
}
+static gboolean
+gtk_emoji_chooser_child_focus (GtkWidget *widget,
+ GtkDirectionType direction)
+{
+ GtkEmojiChooserChild *child = (GtkEmojiChooserChild *)widget;
+
+ if (child->variations && gtk_widget_is_visible (child->variations))
+ {
+ if (gtk_widget_child_focus (child->variations, direction))
+ return TRUE;
+ }
+
+ return GTK_WIDGET_CLASS (gtk_emoji_chooser_child_parent_class)->focus (widget, direction);
+}
+
static void
gtk_emoji_chooser_child_class_init (GtkEmojiChooserChildClass *class)
{
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class);
widget_class->size_allocate = gtk_emoji_chooser_child_size_allocate;
+ widget_class->focus = gtk_emoji_chooser_child_focus;
gtk_widget_class_set_css_name (widget_class, "emoji");
}
@@ -351,6 +367,7 @@ show_variations (GtkEmojiChooser *chooser,
parent_popover = gtk_widget_get_ancestor (child, GTK_TYPE_POPOVER);
popover = ch->variations = gtk_popover_new ();
+ gtk_popover_set_autohide (GTK_POPOVER (popover), TRUE);
gtk_widget_set_parent (popover, child);
view = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_widget_add_css_class (view, "view");