diff options
author | Milan Crha <mcrha@redhat.com> | 2014-03-24 23:21:49 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2014-03-24 23:22:23 +0800 |
commit | ec1862c1497ac44f89c1fe3d92d922b525da96d9 (patch) | |
tree | ffc0b976d290f211bb405c2570ac177387135db5 /e-util | |
parent | eee485721077c5043608a441e5d2f66f536b5ad0 (diff) | |
download | gsoc2013-evolution-ec1862c1497ac44f89c1fe3d92d922b525da96d9.tar gsoc2013-evolution-ec1862c1497ac44f89c1fe3d92d922b525da96d9.tar.gz gsoc2013-evolution-ec1862c1497ac44f89c1fe3d92d922b525da96d9.tar.bz2 gsoc2013-evolution-ec1862c1497ac44f89c1fe3d92d922b525da96d9.tar.lz gsoc2013-evolution-ec1862c1497ac44f89c1fe3d92d922b525da96d9.tar.xz gsoc2013-evolution-ec1862c1497ac44f89c1fe3d92d922b525da96d9.tar.zst gsoc2013-evolution-ec1862c1497ac44f89c1fe3d92d922b525da96d9.zip |
Bug #726110 - Use gtk_drag_check_threshold() instead of hard-coded values
Diffstat (limited to 'e-util')
-rw-r--r-- | e-util/e-table-field-chooser-item.c | 8 | ||||
-rw-r--r-- | e-util/e-table-header-item.c | 8 | ||||
-rw-r--r-- | e-util/e-table-item.c | 3 |
3 files changed, 9 insertions, 10 deletions
diff --git a/e-util/e-table-field-chooser-item.c b/e-util/e-table-field-chooser-item.c index a12ddc6ff7..d713bc3359 100644 --- a/e-util/e-table-field-chooser-item.c +++ b/e-util/e-table-field-chooser-item.c @@ -549,14 +549,14 @@ etfci_maybe_start_drag (ETableFieldChooserItem *etfci, gint x, gint y) { + GnomeCanvasItem *item; + if (!etfci->maybe_drag) return FALSE; - if (MAX (abs (etfci->click_x - x), - abs (etfci->click_y - y)) <= 3) - return FALSE; + item = GNOME_CANVAS_ITEM (etfci); - return TRUE; + return gtk_drag_check_threshold (GTK_WIDGET (item->canvas), etfci->click_x, etfci->click_y, x, y); } static void diff --git a/e-util/e-table-header-item.c b/e-util/e-table-header-item.c index 1f139a67f7..0b93d01433 100644 --- a/e-util/e-table-header-item.c +++ b/e-util/e-table-header-item.c @@ -1202,6 +1202,8 @@ static gboolean ethi_maybe_start_drag (ETableHeaderItem *ethi, GdkEventMotion *event) { + GnomeCanvasItem *item; + if (!ethi->maybe_drag) return FALSE; @@ -1210,11 +1212,9 @@ ethi_maybe_start_drag (ETableHeaderItem *ethi, return FALSE; } - if (MAX (abs (ethi->click_x - event->x), - abs (ethi->click_y - event->y)) <= 3) - return FALSE; + item = GNOME_CANVAS_ITEM (ethi); - return TRUE; + return gtk_drag_check_threshold (GTK_WIDGET (item->canvas), ethi->click_x, ethi->click_y, event->x, event->y); } static void diff --git a/e-util/e-table-item.c b/e-util/e-table-item.c index f48bd3eeb2..9066d6d1d6 100644 --- a/e-util/e-table-item.c +++ b/e-util/e-table-item.c @@ -2745,8 +2745,7 @@ eti_event (GnomeCanvasItem *item, gnome_canvas_item_w2i (item, &event_x_item, &event_y_item); if (eti->maybe_in_drag) { - if (abs (event_x_item - eti->drag_x) >= 3 || - abs (event_y_item - eti->drag_y) >= 3) { + if (gtk_drag_check_threshold (GTK_WIDGET (item->canvas), eti->drag_x, eti->drag_y, event_x_item, event_y_item)) { gboolean drag_handled; eti->maybe_in_drag = 0; |