[PATCH] Improve list view keynav experience



From bug 312046 [1]:

"In the new 2.12 nautilus spatial mode, folders can be expanded
in-place, without opening a new window. One would expect the following
keybindings to work just like they do in the filesystem tree in
browser-mode nautilus. The following keys should work:

+  expand the selected directory
-  collapse the selected directory
*  increase expand-level by one (expand all)"

Proposed patch attached.

[1] http://bugzilla.gnome.org/show_bug.cgi?id=312046

-- 
Christian Neumair <chris gnome-de org>
Index: src/file-manager/fm-list-view.c
===================================================================
RCS file: /cvs/gnome/nautilus/src/file-manager/fm-list-view.c,v
retrieving revision 1.254
diff -u -p -r1.254 fm-list-view.c
--- src/file-manager/fm-list-view.c	14 Jul 2005 08:22:30 -0000	1.254
+++ src/file-manager/fm-list-view.c	30 Jul 2005 14:36:58 -0000
@@ -804,9 +804,26 @@ handle_typeahead (FMListView *view,
 		*flush_typeahead = TRUE;
 		return FALSE;
 	}
-	
-	/* lazily allocate the typeahead state */
+
 	if (view->details->type_select_state == NULL) {
+		/* don't handle '+', '-', '*', '/' if they're not used within a completion context
+		 * they are used by the GTK+ tree view code for expanding/collapsing rows */
+		switch (event->keyval) {
+		case GDK_plus:
+		case GDK_minus:
+		case GDK_asterisk:
+		case GDK_slash:
+		case GDK_KP_Add:
+		case GDK_KP_Subtract:
+		case GDK_KP_Multiply:
+		case GDK_KP_Divide:
+			return FALSE;
+
+		default:
+			break;
+		}
+
+		/* lazily allocate the typeahead state */
 		view->details->type_select_state = g_new0 (TypeSelectState, 1);
 	}
 

Attachment: signature.asc
Description: This is a digitally signed message part



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]