Improve navigation to parent folders. (#318444, Andrei Yurkevich)
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.
This commit is contained in:
parent
14c284c37e
commit
938d34c059
@ -1,5 +1,14 @@
|
|||||||
2005-11-10 Matthias Clasen <mclasen@redhat.com>
|
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,
|
* gtk/gtkmenu.c: Fix some compiler warnings. (#321141,
|
||||||
Kjartan Maraas)
|
Kjartan Maraas)
|
||||||
|
|
||||||
|
@ -1,5 +1,14 @@
|
|||||||
2005-11-10 Matthias Clasen <mclasen@redhat.com>
|
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,
|
* gtk/gtkmenu.c: Fix some compiler warnings. (#321141,
|
||||||
Kjartan Maraas)
|
Kjartan Maraas)
|
||||||
|
|
||||||
|
@ -371,6 +371,7 @@ static void select_func (GtkFileSystemModel *model,
|
|||||||
|
|
||||||
static void path_bar_clicked (GtkPathBar *path_bar,
|
static void path_bar_clicked (GtkPathBar *path_bar,
|
||||||
GtkFilePath *file_path,
|
GtkFilePath *file_path,
|
||||||
|
GtkFilePath *child_path,
|
||||||
gboolean child_is_hidden,
|
gboolean child_is_hidden,
|
||||||
GtkFileChooserDefault *impl);
|
GtkFileChooserDefault *impl);
|
||||||
|
|
||||||
@ -6903,6 +6904,7 @@ list_row_activated (GtkTreeView *tree_view,
|
|||||||
static void
|
static void
|
||||||
path_bar_clicked (GtkPathBar *path_bar,
|
path_bar_clicked (GtkPathBar *path_bar,
|
||||||
GtkFilePath *file_path,
|
GtkFilePath *file_path,
|
||||||
|
GtkFilePath *child_path,
|
||||||
gboolean child_is_hidden,
|
gboolean child_is_hidden,
|
||||||
GtkFileChooserDefault *impl)
|
GtkFileChooserDefault *impl)
|
||||||
{
|
{
|
||||||
@ -6916,7 +6918,17 @@ path_bar_clicked (GtkPathBar *path_bar,
|
|||||||
if (child_is_hidden)
|
if (child_is_hidden)
|
||||||
g_object_set (impl, "show-hidden", TRUE, NULL);
|
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 *
|
static const GtkFileInfo *
|
||||||
|
@ -88,6 +88,7 @@ VOID:OBJECT,STRING
|
|||||||
VOID:POINTER
|
VOID:POINTER
|
||||||
VOID:POINTER,INT
|
VOID:POINTER,INT
|
||||||
VOID:POINTER,BOOLEAN
|
VOID:POINTER,BOOLEAN
|
||||||
|
VOID:POINTER,POINTER,BOOLEAN
|
||||||
VOID:POINTER,POINTER,POINTER
|
VOID:POINTER,POINTER,POINTER
|
||||||
VOID:POINTER,UINT
|
VOID:POINTER,UINT
|
||||||
VOID:STRING
|
VOID:STRING
|
||||||
|
@ -191,8 +191,9 @@ gtk_path_bar_class_init (GtkPathBarClass *path_bar_class)
|
|||||||
G_SIGNAL_RUN_FIRST,
|
G_SIGNAL_RUN_FIRST,
|
||||||
G_STRUCT_OFFSET (GtkPathBarClass, path_clicked),
|
G_STRUCT_OFFSET (GtkPathBarClass, path_clicked),
|
||||||
NULL, NULL,
|
NULL, NULL,
|
||||||
_gtk_marshal_VOID__POINTER_BOOLEAN,
|
_gtk_marshal_VOID__POINTER_POINTER_BOOLEAN,
|
||||||
G_TYPE_NONE, 2,
|
G_TYPE_NONE, 3,
|
||||||
|
G_TYPE_POINTER,
|
||||||
G_TYPE_POINTER,
|
G_TYPE_POINTER,
|
||||||
G_TYPE_BOOLEAN);
|
G_TYPE_BOOLEAN);
|
||||||
}
|
}
|
||||||
@ -942,17 +943,23 @@ button_clicked_cb (GtkWidget *button,
|
|||||||
|
|
||||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
|
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (button), TRUE);
|
||||||
|
|
||||||
|
GtkFilePath *child_path;
|
||||||
if (button_list->prev)
|
if (button_list->prev)
|
||||||
{
|
{
|
||||||
ButtonData *child_data;
|
ButtonData *child_data;
|
||||||
|
|
||||||
child_data = BUTTON_DATA (button_list->prev->data);
|
child_data = BUTTON_DATA (button_list->prev->data);
|
||||||
|
child_path = child_data->path;
|
||||||
child_is_hidden = child_data->file_is_hidden;
|
child_is_hidden = child_data->file_is_hidden;
|
||||||
}
|
}
|
||||||
else
|
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 *
|
static GdkPixbuf *
|
||||||
|
@ -72,6 +72,7 @@ struct _GtkPathBarClass
|
|||||||
|
|
||||||
void (* path_clicked) (GtkPathBar *path_bar,
|
void (* path_clicked) (GtkPathBar *path_bar,
|
||||||
GtkFilePath *file_path,
|
GtkFilePath *file_path,
|
||||||
|
GtkFilePath *child_path,
|
||||||
gboolean child_is_hidden);
|
gboolean child_is_hidden);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user