summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2006-08-08 13:34:22 +0000
committerAlexander Larsson <alexl@src.gnome.org>2006-08-08 13:34:22 +0000
commit639a1486d91e8c5d6da67d7d057b221b80757bd6 (patch)
tree52cd62798f05db23d28d8b0d703e0ba37088efdb
parentf3ac9d424974271f475f01ca7335386c626b4925 (diff)
downloadnautilus-639a1486d91e8c5d6da67d7d057b221b80757bd6.tar.gz
Fix down when in the rightmost column in the next to last row (#316117)
2006-08-08 Alexander Larsson <alexl@redhat.com> * libnautilus-private/nautilus-icon-container.c: Fix down when in the rightmost column in the next to last row (#316117) Based on patch from Nelson Benitez
-rw-r--r--ChangeLog6
-rw-r--r--libnautilus-private/nautilus-icon-container.c65
2 files changed, 58 insertions, 13 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d4ec4b63..c6900b50b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2006-08-08 Alexander Larsson <alexl@redhat.com>
+ * libnautilus-private/nautilus-icon-container.c:
+ Fix down when in the rightmost column in the next to last row (#316117)
+ Based on patch from Nelson Benitez
+
+2006-08-08 Alexander Larsson <alexl@redhat.com>
+
* libnautilus-private/nautilus-file-operations.c:
Handle desktop drops from panel. (#347673)
Patch from Christian Neumair
diff --git a/libnautilus-private/nautilus-icon-container.c b/libnautilus-private/nautilus-icon-container.c
index 1d0bbea58..78b39203a 100644
--- a/libnautilus-private/nautilus-icon-container.c
+++ b/libnautilus-private/nautilus-icon-container.c
@@ -2297,6 +2297,45 @@ compare_icons_horizontal_first (NautilusIconContainer *container,
}
static int
+compare_icons_vertical_first_reverse_horizontal (NautilusIconContainer *container,
+ NautilusIcon *icon_a,
+ NautilusIcon *icon_b)
+{
+ ArtDRect world_rect;
+ int ax, ay, bx, by;
+
+ world_rect = nautilus_icon_canvas_item_get_icon_rectangle (icon_a->item);
+ eel_canvas_w2c
+ (EEL_CANVAS (container),
+ get_cmp_point_x (container, world_rect),
+ get_cmp_point_y (container, world_rect),
+ &ax,
+ &ay);
+ world_rect = nautilus_icon_canvas_item_get_icon_rectangle (icon_b->item);
+ eel_canvas_w2c
+ (EEL_CANVAS (container),
+ get_cmp_point_x (container, world_rect),
+ get_cmp_point_y (container, world_rect),
+ &bx,
+ &by);
+
+ if (ay < by) {
+ return -1;
+ }
+ if (ay > by) {
+ return +1;
+ }
+ if (ax < bx) {
+ return +1;
+ }
+ if (ax > bx) {
+ return -1;
+ }
+ return compare_icons_by_uri (container, icon_a, icon_b);
+}
+
+
+static int
compare_icons_vertical_first (NautilusIconContainer *container,
NautilusIcon *icon_a,
NautilusIcon *icon_b)
@@ -2494,25 +2533,25 @@ same_column_below_highest (NautilusIconContainer *container,
NautilusIcon *candidate,
void *data)
{
- /* Candidates not on the start column do not qualify. */
- if (compare_with_start_column (container, candidate) != 0) {
+ EelCanvasItem *item;
+
+ item = EEL_CANVAS_ITEM (candidate->item);
+
+ /* Candidates above or on the start row do not qualify. */
+ if (container->details->arrow_key_start_y >= item->y1) {
return FALSE;
}
- /* Candidates that are lower lose out. */
if (best_so_far != NULL) {
- if (compare_icons_vertical_first (container,
- best_so_far,
- candidate) < 0) {
+ /* Candidates on the start column are preferred. */
+ if (compare_with_start_column (container, candidate) != 0 &&
+ compare_with_start_column (container, best_so_far) == 0) {
+ return FALSE;
+ }
+ /* Candidates that are lower or to the left lose out. */
+ if (compare_icons_vertical_first_reverse_horizontal (container, best_so_far, candidate) <= 0) {
return FALSE;
}
- }
-
- /* Candidate above the start do not qualify. */
- if (compare_icons_vertical_first (container,
- candidate,
- start_icon) <= 0) {
- return FALSE;
}
return TRUE;