diff options
author | Markus T. Vartiainen <mtvartia@gmail.com> | 2011-01-18 14:37:05 +0100 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2011-01-18 14:37:05 +0100 |
commit | 9eee9ff6ca3e93d5d363725282d8ba393a1e6d01 (patch) | |
tree | 6b706896adf19478635f02f0c18b5d18f6268293 | |
parent | c6fa6b2062a1adf3e4945824048b3771edb35ebe (diff) | |
download | nautilus-9eee9ff6ca3e93d5d363725282d8ba393a1e6d01.tar.gz |
list-view: jump to parent with left key on collapsed rows (#639688)
-rw-r--r-- | src/nautilus-list-view.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/nautilus-list-view.c b/src/nautilus-list-view.c index 92f02c57e..b6ee0b92d 100644 --- a/src/nautilus-list-view.c +++ b/src/nautilus-list-view.c @@ -1009,7 +1009,15 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat case GDK_KEY_Left: gtk_tree_view_get_cursor (tree_view, &path, NULL); if (path) { - gtk_tree_view_collapse_row (tree_view, path); + if (!gtk_tree_view_collapse_row (tree_view, path)) { + /* if the row is already collapsed or doesn't have any children, + * jump to the parent row instead. + */ + if ((gtk_tree_path_get_depth (path) > 1) && gtk_tree_path_up (path)) { + gtk_tree_view_set_cursor (tree_view, path, NULL, FALSE); + } + } + gtk_tree_path_free (path); } handled = TRUE; |