2005-11-10 Matthias Clasen <mclasen@redhat.com>
+ Improve navigation to parent folders. (#318444, Andrei Yurkevich)
+
+ * gtk/gtkpathbar.[hc]: Add a child_path argument to
+ the path_clicked signal.
+ * gtk/gtkfilechooserdefault.c (path_bar_clicked): Select the
+ child_path, if it is provided.
+ * gtk/marshalers.list (path_bar_clicked): Add the necessary
+ glue.
+
* gtk/gtkmenu.c: Fix some compiler warnings. (#321141,
Kjartan Maraas)
2005-11-10 Matthias Clasen <mclasen@redhat.com>
+ Improve navigation to parent folders. (#318444, Andrei Yurkevich)
+
+ * gtk/gtkpathbar.[hc]: Add a child_path argument to
+ the path_clicked signal.
+ * gtk/gtkfilechooserdefault.c (path_bar_clicked): Select the
+ child_path, if it is provided.
+ * gtk/marshalers.list (path_bar_clicked): Add the necessary
+ glue.
+
* gtk/gtkmenu.c: Fix some compiler warnings. (#321141,
Kjartan Maraas)
static void path_bar_clicked (GtkPathBar *path_bar,
GtkFilePath *file_path,
+ GtkFilePath *child_path,
gboolean child_is_hidden,
GtkFileChooserDefault *impl);
static void
path_bar_clicked (GtkPathBar *path_bar,
GtkFilePath *file_path,
+ GtkFilePath *child_path,
gboolean child_is_hidden,
GtkFileChooserDefault *impl)
{
if (child_is_hidden)
g_object_set (impl, "show-hidden", TRUE, NULL);
- //gtk_widget_grab_focus (impl->browse_files_tree_view);
+ /* Say we have "/foo/bar/baz" and the user clicks on "bar". We should then
+ * focus the "baz" entry in the files list - the reason for this is that
+ * if user furst changed to /foo/bar/baz from /foo/bar unintentionally
+ * instead of /foo/bar/baz1, it will take quite some time to scroll to baz1
+ * in the file list, especially if this directory contains lots of folders
+ */
+ if (child_path != NULL)
+ {
+ gtk_file_chooser_default_select_path (impl, child_path, NULL);
+ browse_files_center_selected_row (impl);
+ }
}
static const GtkFileInfo *
VOID:POINTER
VOID:POINTER,INT
VOID:POINTER,BOOLEAN
+VOID:POINTER,POINTER,BOOLEAN
VOID:POINTER,POINTER,POINTER
VOID:POINTER,UINT
VOID:STRING
G_SIGNAL_RUN_FIRST,
G_STRUCT_OFFSET (GtkPathBarClass, path_clicked),
NULL, NULL,
- _gtk_marshal_VOID__POINTER_BOOLEAN,
- G_TYPE_NONE, 2,
+ _gtk_marshal_VOID__POINTER_POINTER_BOOLEAN,
+ G_TYPE_NONE, 3,
+ G_TYPE_POINTER,
G_TYPE_POINTER,
G_TYPE_BOOLEAN);
}
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
+ GtkFilePath *child_path;
if (button_list->prev)
{
ButtonData *child_data;
child_data = BUTTON_DATA (button_list->prev->data);
+ child_path = child_data->path;
child_is_hidden = child_data->file_is_hidden;
}
else
- child_is_hidden = FALSE;
+ {
+ child_path = NULL;
+ child_is_hidden = FALSE;
+ }
- g_signal_emit (path_bar, path_bar_signals [PATH_CLICKED], 0, button_data->path, child_is_hidden);
+ g_signal_emit (path_bar, path_bar_signals [PATH_CLICKED], 0,
+ button_data->path, child_path, child_is_hidden);
}
static GdkPixbuf *
void (* path_clicked) (GtkPathBar *path_bar,
GtkFilePath *file_path,
+ GtkFilePath *child_path,
gboolean child_is_hidden);
};