summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Martin Szulecki2009-12-27 00:12:13 +0100
committerGravatar Martin Szulecki2009-12-27 00:12:13 +0100
commit2e71c1bc12681760ca528bd9ece829b08c8b53c1 (patch)
tree8b3f02d603c75f5cfa3752dcc4e4d3245e754d61
parent4ca342f5332930592561c3c37cf67db67e32f781 (diff)
parent050c597ecdbd0869489582e07b437eaa0bb10cd3 (diff)
downloadsbmanager-2e71c1bc12681760ca528bd9ece829b08c8b53c1.tar.gz
sbmanager-2e71c1bc12681760ca528bd9ece829b08c8b53c1.tar.bz2
Merge branch 'master' of http://pims.selfip.net/git/sbmanager
-rw-r--r--src/sbmanager.c31
1 files changed, 24 insertions, 7 deletions
diff --git a/src/sbmanager.c b/src/sbmanager.c
index c3bbb95..3976f88 100644
--- a/src/sbmanager.c
+++ b/src/sbmanager.c
@@ -81,6 +81,8 @@ SBItem *selected_item = NULL;
gfloat start_x = 0.0;
gfloat start_y = 0.0;
+gboolean move_left = TRUE;
+
GList *dockitems = NULL;
GList *sbpages = NULL;
@@ -652,13 +654,22 @@ 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;
- }
- if (item_x < xpos + 30) {
- newpos = i;
- break;
+ 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 (ixpos < xpos + 40) {
+ newpos = i;
+ break;
+ }
+ } else {
+ if (ixpos < xpos - 10) {
+ newpos = i;
+ break;
+ }
}
}
@@ -676,6 +687,12 @@ static gboolean stage_motion(ClutterActor *actor, ClutterMotionEvent *event, gpo
clutter_actor_move_by(icon, (event->x - start_x), (event->y - start_y));
+ if (event->x-start_x > 0) {
+ move_left = FALSE;
+ } else {
+ move_left = TRUE;
+ }
+
start_x = event->x;
start_y = event->y;