summaryrefslogtreecommitdiff
path: root/src/nautilus-search-popover.c
diff options
context:
space:
mode:
authorErnestas Kulik <ernestask@gnome.org>2017-08-17 12:29:45 +0300
committerCarlos Soriano <csoriano@localhost.localdomain>2017-08-17 15:37:23 +0200
commit6e2379ea4d88539b27bfddac1f7bcae4ef7597e2 (patch)
treed0f222a22d529c3f065059231ca588988ecad25e /src/nautilus-search-popover.c
parenta6d616e18dc46630d170d09fc84ac824de7d4fdf (diff)
downloadnautilus-6e2379ea4d88539b27bfddac1f7bcae4ef7597e2.tar.gz
search-popover: make type list box keyboard-navigable
Currently, the type list box in the search popover is not keyboard-navigable, which, as a consequence, results in the user’s inability to also easily close the popover. https://bugzilla.gnome.org/show_bug.cgi?id=786402
Diffstat (limited to 'src/nautilus-search-popover.c')
-rw-r--r--src/nautilus-search-popover.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/nautilus-search-popover.c b/src/nautilus-search-popover.c
index 7f8136a5e..240136386 100644
--- a/src/nautilus-search-popover.c
+++ b/src/nautilus-search-popover.c
@@ -265,7 +265,15 @@ static void
select_type_button_clicked (GtkButton *button,
NautilusSearchPopover *popover)
{
+ GtkListBoxRow *selected_row;
+
+ selected_row = gtk_list_box_get_selected_row (GTK_LIST_BOX (popover->type_listbox));
+
gtk_stack_set_visible_child_name (GTK_STACK (popover->type_stack), "type-list");
+ if (selected_row != NULL)
+ {
+ gtk_widget_grab_focus (GTK_WIDGET (selected_row));
+ }
/* Hide the date selection widgets when the type selection
* listbox is shown.
@@ -883,6 +891,9 @@ nautilus_search_popover_init (NautilusSearchPopover *self)
fill_types_listbox (self);
+ gtk_list_box_select_row (GTK_LIST_BOX (self->type_listbox),
+ gtk_list_box_get_row_at_index (GTK_LIST_BOX (self->type_listbox), 0));
+
filter_time_type = g_settings_get_enum (nautilus_preferences, "search-filter-time-type");
if (filter_time_type == NAUTILUS_QUERY_SEARCH_TYPE_LAST_MODIFIED)
{