diff options
author | Christian Neumair <cneumair@gnome.org> | 2008-06-28 11:32:23 +0000 |
---|---|---|
committer | Christian Neumair <cneumair@src.gnome.org> | 2008-06-28 11:32:23 +0000 |
commit | 553f112f19b0c71b1c3f09cd44c075e0611dcae6 (patch) | |
tree | 2216c95491dd9305f05941fbe38bf5e7af17ec0c | |
parent | 6174f9af4c38533d739ec217d26dac5054d38f8d (diff) | |
download | nautilus-553f112f19b0c71b1c3f09cd44c075e0611dcae6.tar.gz |
If no icon is selected, but an icon has the keyboard focus, select it when
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.
svn path=/branches/gnome-2-22/; revision=14286
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | libnautilus-private/nautilus-icon-container.c | 13 |
2 files changed, 17 insertions, 4 deletions
@@ -1,3 +1,11 @@ +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. + 2008-06-23 Cosimo Cecchi <cosimoc@gnome.org> * configure.in: require libbeagle >= 0.2.4. (#351288). diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index df4335529..200aa48fd 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -2747,13 +2747,13 @@ keyboard_move_to (NautilusIconContainer *container, 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 @@ keyboard_space (NautilusIconContainer *container, { 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); |