diff options
author | Alexander Larsson <alexl@redhat.com> | 2003-01-20 14:22:53 +0000 |
---|---|---|
committer | Alexander Larsson <alexl@src.gnome.org> | 2003-01-20 14:22:53 +0000 |
commit | 5b0254baa4853d9453319504c729802cc34f70ba (patch) | |
tree | a54d1c6f36249bd5bfd3d2b4a78adbf7120b7a1c /libnautilus-private | |
parent | fdeb504d3f49df847440a41e0fde41aa59d8f52b (diff) | |
download | nautilus-5b0254baa4853d9453319504c729802cc34f70ba.tar.gz |
When deleting an icon with the keyboard focus, set focus on an adjacent
2003-01-20 Alexander Larsson <alexl@redhat.com>
* libnautilus-private/nautilus-icon-container.c:
When deleting an icon with the keyboard focus, set focus on
an adjacent icon.
Diffstat (limited to 'libnautilus-private')
-rw-r--r-- | libnautilus-private/nautilus-icon-container.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c index c93c77665..4337c5fc3 100644 --- a/libnautilus-private/nautilus-icon-container.c +++ b/libnautilus-private/nautilus-icon-container.c @@ -3825,17 +3825,28 @@ icon_destroy (NautilusIconContainer *container, { NautilusIconContainerDetails *details; gboolean was_selected; - + NautilusIcon *icon_to_focus; + GList *item; + details = container->details; + item = g_list_find (details->icons, icon); + item = item->next ? item->next : item->prev; + icon_to_focus = (item != NULL) ? item->data : NULL; + details->icons = g_list_remove (details->icons, icon); details->new_icons = g_list_remove (details->new_icons, icon); g_hash_table_remove (details->icon_set, icon->data); was_selected = icon->is_selected; - if (details->keyboard_focus == icon) { - clear_keyboard_focus (container); + if (details->keyboard_focus == icon || + details->keyboard_focus == NULL) { + if (icon_to_focus != NULL) { + set_keyboard_focus (container, icon_to_focus); + } else { + clear_keyboard_focus (container); + } } if (details->keyboard_icon_to_reveal == icon) { unschedule_keyboard_icon_reveal (container); |