filechooserwidget: Allow keynav from the treeview to the search entry
This commit is contained in:
@@ -7673,6 +7673,24 @@ list_cursor_changed (GtkTreeView *list,
|
||||
check_preview_change (impl);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
browse_files_tree_view_keynav_failed_cb (GtkWidget *widget,
|
||||
GtkDirectionType direction,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkFileChooserWidget *self = user_data;
|
||||
GtkFileChooserWidgetPrivate *priv = gtk_file_chooser_widget_get_instance_private (self);
|
||||
|
||||
if (direction == GTK_DIR_UP && priv->operation_mode == OPERATION_MODE_SEARCH)
|
||||
{
|
||||
gtk_widget_grab_focus (priv->search_entry);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Callback used when a row in the file list is activated */
|
||||
static void
|
||||
list_row_activated (GtkTreeView *tree_view,
|
||||
@@ -8400,6 +8418,7 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
|
||||
gtk_widget_class_bind_template_callback (widget_class, file_list_drag_end_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, list_selection_changed);
|
||||
gtk_widget_class_bind_template_callback (widget_class, list_cursor_changed);
|
||||
gtk_widget_class_bind_template_callback (widget_class, browse_files_tree_view_keynav_failed_cb);
|
||||
gtk_widget_class_bind_template_callback (widget_class, filter_combo_changed);
|
||||
gtk_widget_class_bind_template_callback (widget_class, path_bar_clicked);
|
||||
gtk_widget_class_bind_template_callback (widget_class, places_sidebar_open_location_cb);
|
||||
|
||||
@@ -168,6 +168,7 @@
|
||||
<signal name="query-tooltip" handler="file_list_query_tooltip_cb" swapped="no"/>
|
||||
<signal name="row-activated" handler="list_row_activated" swapped="no"/>
|
||||
<signal name="cursor-changed" handler="list_cursor_changed" swapped="no"/>
|
||||
<signal name="keynav-failed" handler="browse_files_tree_view_keynav_failed_cb" />
|
||||
<child internal-child="selection">
|
||||
<object class="GtkTreeSelection" id="treeview-selection2">
|
||||
<signal name="changed" handler="list_selection_changed" swapped="no"/>
|
||||
|
||||
Reference in New Issue
Block a user