Commit 5b49b797 authored by Christian Neumair's avatar Christian Neumair Committed by Christian Neumair

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=/trunk/; revision=14285
parent 1a01bd10
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 Rodney Dawes <dobey.pwns@gmail.com>
* libnautilus-private/nautilus-emblem-utils.c:
......
......@@ -3098,13 +3098,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;
......@@ -3356,8 +3356,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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment