From 050c597ecdbd0869489582e07b437eaa0bb10cd3 Mon Sep 17 00:00:00 2001 From: Nikias Bassen Date: Sat, 26 Dec 2009 23:34:40 +0100 Subject: Some way better multirow icon aligment --- src/sbmanager.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/sbmanager.c b/src/sbmanager.c index 4b8a5c7..3976f88 100644 --- a/src/sbmanager.c +++ b/src/sbmanager.c @@ -654,17 +654,19 @@ static GList *insert_into_icon_list(GList *iconlist, SBItem *newitem, gfloat ite gfloat xpos = clutter_actor_get_x(icon); gfloat ypos = clutter_actor_get_y(icon); - if ((item_y > ypos + 70) || (item_y < ypos - 10)) { - /* this is not the row we are in */ - continue; - } + gint nrow = (ypos - 16) / 88; + gint irow = (item_y - 16) / 88; + + xpos += nrow*STAGE_WIDTH; + gfloat ixpos = item_x + irow*STAGE_WIDTH; + if (move_left) { - if (item_x < xpos + 40) { + if (ixpos < xpos + 40) { newpos = i; break; } } else { - if (item_x < xpos - 10) { + if (ixpos < xpos - 10) { newpos = i; break; } -- cgit v1.1-32-gdbae