nautilus r14286 - in branches/gnome-2-22: . libnautilus-private



Author: cneumair
Date: Sat Jun 28 11:32:23 2008
New Revision: 14286
URL: http://svn.gnome.org/viewvc/nautilus?rev=14286&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:
   branches/gnome-2-22/ChangeLog
   branches/gnome-2-22/libnautilus-private/nautilus-icon-container.c

Modified: branches/gnome-2-22/libnautilus-private/nautilus-icon-container.c
==============================================================================
--- branches/gnome-2-22/libnautilus-private/nautilus-icon-container.c	(original)
+++ branches/gnome-2-22/libnautilus-private/nautilus-icon-container.c	Sat Jun 28 11:32:23 2008
@@ -2747,13 +2747,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;
 
@@ -2982,8 +2982,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]