summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2009-12-26 21:51:36 +0100
committerGravatar Nikias Bassen2009-12-26 21:51:36 +0100
commit3871f88ea4b2238bdcc48113ad8737803ec77894 (patch)
treedaf4ca2e519b205e83814569c989f9ee6afc79af /src
parent30aa6a6fd056fabefb0e4c3209a2bc3569d9b488 (diff)
downloadsbmanager-3871f88ea4b2238bdcc48113ad8737803ec77894.tar.gz
sbmanager-3871f88ea4b2238bdcc48113ad8737803ec77894.tar.bz2
Add a threshold for left-right movement in icon alignment
Diffstat (limited to 'src')
-rw-r--r--src/sbmanager.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/sbmanager.c b/src/sbmanager.c
index c3bbb95..4b8a5c7 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;
@@ -656,9 +658,16 @@ static GList *insert_into_icon_list(GList *iconlist, SBItem *newitem, gfloat ite
/* this is not the row we are in */
continue;
}
- if (item_x < xpos + 30) {
- newpos = i;
- break;
+ if (move_left) {
+ if (item_x < xpos + 40) {
+ newpos = i;
+ break;
+ }
+ } else {
+ if (item_x < xpos - 10) {
+ newpos = i;
+ break;
+ }
}
}
@@ -676,6 +685,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;