[nautilus] icon-container: set a range base selection icon on _set_selection()
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] icon-container: set a range base selection icon on _set_selection()
- Date: Sat, 17 Mar 2012 00:03:14 +0000 (UTC)
commit f8f4f5a241dd99c04be8f327aed3316c9d87f1b2
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Fri Mar 16 20:01:01 2012 -0400
icon-container: set a range base selection icon on _set_selection()
If the selection we set if just one item (as it is in the case when
we're going back/forward in the history), set that item as a base for
range selection too, instead of just selecting it.
https://bugzilla.gnome.org/show_bug.cgi?id=672127
libnautilus-private/nautilus-icon-container.c | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index 9f99dc8..fea75b6 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -7497,11 +7497,13 @@ nautilus_icon_container_set_selection (NautilusIconContainer *container,
gboolean selection_changed;
GHashTable *hash;
GList *p;
- NautilusIcon *icon;
+ gboolean res;
+ NautilusIcon *icon, *selected_icon;
g_return_if_fail (NAUTILUS_IS_ICON_CONTAINER (container));
selection_changed = FALSE;
+ selected_icon = NULL;
hash = g_hash_table_new (NULL, NULL);
for (p = selection; p != NULL; p = p->next) {
@@ -7510,13 +7512,24 @@ nautilus_icon_container_set_selection (NautilusIconContainer *container,
for (p = container->details->icons; p != NULL; p = p->next) {
icon = p->data;
- selection_changed |= icon_set_selected
+ res = icon_set_selected
(container, icon,
g_hash_table_lookup (hash, icon->data) != NULL);
+ selection_changed |= res;
+
+ if (res) {
+ selected_icon = icon;
+ }
}
g_hash_table_destroy (hash);
if (selection_changed) {
+ /* if only one item has been selected, use it as range
+ * selection base (cf. handle_icon_button_press) */
+ if (g_list_length (selection) == 1) {
+ container->details->range_selection_base_icon = selected_icon;
+ }
+
g_signal_emit (container,
signals[SELECTION_CHANGED], 0);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]