nautilus r14285 - in trunk: . libnautilus-private



Author: cneumair
Date: Sat Jun 28 11:32:18 2008
New Revision: 14285
URL: http://svn.gnome.org/viewvc/nautilus?rev=14285&view=rev

Log:
2008-06-28  Christian Neumair  <cneumair gnome org>

	* libnautilus-private/nautilus-icon-container.c (keyboard_move_to),
	(keyboard_space):
	If no icon is selected, but an icon has the keyboard focus, select it
	when pressing space. Thanks to Nelson BenÃtez LeÃn, A. Walton and Amir
	Reza Khosroshahi. Fixes #378202.


Modified:
   trunk/ChangeLog
   trunk/libnautilus-private/nautilus-icon-container.c

Modified: trunk/libnautilus-private/nautilus-icon-container.c
==============================================================================
--- trunk/libnautilus-private/nautilus-icon-container.c	(original)
+++ trunk/libnautilus-private/nautilus-icon-container.c	Sat Jun 28 11:32:18 2008
@@ -3098,13 +3098,13 @@
 		return;
 	}
 
-	if ((event->state & GDK_CONTROL_MASK) != 0) {
+	if (event != NULL && (event->state & GDK_CONTROL_MASK) != 0) {
 		/* Move the keyboard focus. Use Control modifier
 		 * rather than Alt to avoid Sawfish conflict.
 		 */
 		set_keyboard_focus (container, icon);
 		container->details->keyboard_rubberband_start = NULL;
-	} else if ((event->state & GDK_SHIFT_MASK) != 0) {
+	} else if (event != NULL && (event->state & GDK_SHIFT_MASK) != 0) {
 		/* Do rubberband selection */		
 		EelDRect rect;
 
@@ -3356,8 +3356,13 @@
 {
 	NautilusIcon *icon;
 	
-	/* Control-space toggles the selection state of the current icon. */
-	if ((event->state & GDK_CONTROL_MASK) != 0) {
+	if (!has_selection (container) &&
+	    container->details->keyboard_focus != NULL) {
+		keyboard_move_to (container,
+				  container->details->keyboard_focus,
+				  NULL, NULL);
+	} else if ((event->state & GDK_CONTROL_MASK) != 0) {
+		/* Control-space toggles the selection state of the current icon. */
 		if (container->details->keyboard_focus != NULL) {
 			icon_toggle_selected (container, container->details->keyboard_focus);
 			g_signal_emit (container, signals[SELECTION_CHANGED], 0);



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