[PATCH] Proposed changes for "Keep Aligned"
- From: Bill Smith <snowmanam2 gmail com>
- Subject: [PATCH] Proposed changes for "Keep Aligned"
- Date: Mon, 18 Jan 2010 12:46:16 -0500
Replaces snap_position() with schedule_align_icons() when moving icons, and
fixes icon alignment when new icons are added.
---
libnautilus-private/nautilus-icon-container.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index ae58a49..ca271e1 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -225,6 +225,8 @@ static int compare_icons_vertical (NautilusIconContainer *container,
static void store_layout_timestamps_now (NautilusIconContainer *container);
+static void schedule_align_icons (NautilusIconContainer *container);
+
static gpointer accessible_parent_class;
static GQuark accessible_private_data_quark = 0;
@@ -2428,15 +2430,15 @@ nautilus_icon_container_move_icon (NautilusIconContainer *container,
}
if (!details->auto_layout) {
- if (details->keep_aligned && snap) {
- snap_position (container, icon, &x, &y);
- }
-
if (x != icon->x || y != icon->y) {
icon_set_position (icon, x, y);
emit_signal = update_position;
}
+ if (details->keep_aligned && snap) {
+ schedule_align_icons (container);
+ }
+
icon->saved_ltr_x = nautilus_icon_container_is_layout_rtl (container) ? get_mirror_x_position (container, icon, icon->x) : icon->x;
}
@@ -7324,6 +7326,10 @@ nautilus_icon_container_add (NautilusIconContainer *container,
/* Run an idle function to add the icons. */
schedule_redo_layout (container);
+ if (container->details->keep_aligned) {
+ schedule_align_icons(container);
+ }
+
return TRUE;
}
--
1.6.3.3
--=-4jY59wPWpTG7kdZv++sj--
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]