mirror of
https://gitlab.gnome.org/GNOME/nautilus
synced 2024-10-29 03:34:16 +00:00
list-base: Allow to tab directly out of view
Now that the views contain real widgets, Tab and Shift+Tab cycle through every item and only allow leaving the view when at the end or start of the list, respectively. This is frustrating for directories with more than a handful of files. Also, users expect to use arrow keys to cycle though items already. So, allow to tab into and out of the view, but not inside.
This commit is contained in:
parent
fcbfb284e3
commit
77cd0f94b7
1 changed files with 11 additions and 0 deletions
|
@ -1710,6 +1710,17 @@ nautilus_list_base_focus (GtkWidget *widget,
|
|||
gboolean no_selection;
|
||||
gboolean handled;
|
||||
|
||||
/* If focus is already inside the view, allow to immediately tab out of it,
|
||||
* instead of having to cycle through every item (potentially many). */
|
||||
if (direction == GTK_DIR_TAB_FORWARD || direction == GTK_DIR_TAB_BACKWARD)
|
||||
{
|
||||
GtkWidget *focus_widget = gtk_root_get_focus (gtk_widget_get_root (widget));
|
||||
if (focus_widget != NULL && gtk_widget_is_ancestor (focus_widget, widget))
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
selection = nautilus_view_get_selection (NAUTILUS_VIEW (self));
|
||||
no_selection = (selection == NULL);
|
||||
|
||||
|
|
Loading…
Reference in a new issue