summaryrefslogtreecommitdiff
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
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
-rw-r--r--src/nautilus-search-popover.c11
-rw-r--r--src/resources/ui/nautilus-search-popover.ui2
2 files changed, 12 insertions, 1 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)
{
diff --git a/src/resources/ui/nautilus-search-popover.ui b/src/resources/ui/nautilus-search-popover.ui
index 82a948a85..3f42de326 100644
--- a/src/resources/ui/nautilus-search-popover.ui
+++ b/src/resources/ui/nautilus-search-popover.ui
@@ -315,7 +315,7 @@
<object class="GtkListBox" id="type_listbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="selection_mode">none</property>
+ <property name="selection_mode">single</property>
<signal name="row-activated" handler="types_listbox_row_activated" object="NautilusSearchPopover" swapped="no" />
</object>
</child>