[nautilus] Adds key binding for expanding and collapsing folders in list view
- From: Marcus Carlson <mdc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Adds key binding for expanding and collapsing folders in list view
- Date: Sun, 11 Jul 2010 20:04:03 +0000 (UTC)
commit 8ef7a9a1a1bdd02926b8b1fe59a6e97cf6c69574
Author: Marcus Carlson <mdc src gnome org>
Date: Sat Jul 10 00:14:00 2010 +0200
Adds key binding for expanding and collapsing folders in list view
https://bugzilla.gnome.org/show_bug.cgi?id=504869
src/file-manager/fm-list-view.c | 20 ++++++++++++++++++++
1 files changed, 20 insertions(+), 0 deletions(-)
---
diff --git a/src/file-manager/fm-list-view.c b/src/file-manager/fm-list-view.c
index a0f5d5b..724461e 100644
--- a/src/file-manager/fm-list-view.c
+++ b/src/file-manager/fm-list-view.c
@@ -982,6 +982,10 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat
FMDirectoryView *view;
GdkEventButton button_event = { 0 };
gboolean handled;
+ GtkTreeView *tree_view;
+ GtkTreePath *path;
+
+ tree_view = GTK_TREE_VIEW (widget);
view = FM_DIRECTORY_VIEW (callback_data);
handled = FALSE;
@@ -993,6 +997,22 @@ key_press_callback (GtkWidget *widget, GdkEventKey *event, gpointer callback_dat
handled = TRUE;
}
break;
+ case GDK_Right:
+ gtk_tree_view_get_cursor (tree_view, &path, NULL);
+ if (path) {
+ gtk_tree_view_expand_row (tree_view, path, FALSE);
+ gtk_tree_path_free (path);
+ }
+ handled = TRUE;
+ break;
+ case GDK_Left:
+ gtk_tree_view_get_cursor (tree_view, &path, NULL);
+ if (path) {
+ gtk_tree_view_collapse_row (tree_view, path);
+ gtk_tree_path_free (path);
+ }
+ handled = TRUE;
+ break;
case GDK_space:
if (event->state & GDK_CONTROL_MASK) {
handled = FALSE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]