From 52479d72c9ce83657ba8237f4924334bee546832 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Minisini?= Date: Sun, 26 Jan 2014 23:23:35 +0000 Subject: [PATCH] [GB.GTK] * BUG: The MouseDrag event can be cancelled now, like with gb.qt4. [GB.GTK3] * BUG: The MouseDrag event can be cancelled now, like with gb.qt4. git-svn-id: svn://localhost/gambas/trunk@6105 867c0c6c-44f3-4631-809d-bfa615b0a4ec --- gb.gtk/src/CStyle.cpp | 4 +--- gb.gtk/src/gapplication.cpp | 10 +++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gb.gtk/src/CStyle.cpp b/gb.gtk/src/CStyle.cpp index c9f7306b6..aca8a0a1d 100644 --- a/gb.gtk/src/CStyle.cpp +++ b/gb.gtk/src/CStyle.cpp @@ -544,9 +544,7 @@ static void style_panel(int x, int y, int w, int h, int border, int state) default: shadow = GTK_SHADOW_NONE; } - gtk_paint_shadow(style, _dr, - st, shadow, get_area(), NULL, NULL, - x, y, w, h); + gtk_paint_shadow(style, _dr, st, shadow, get_area(), NULL, NULL, x, y, w, h); if (border == BORDER_PLAIN) { diff --git a/gb.gtk/src/gapplication.cpp b/gb.gtk/src/gapplication.cpp index a53a9e370..bc4f7e483 100644 --- a/gb.gtk/src/gapplication.cpp +++ b/gb.gtk/src/gapplication.cpp @@ -610,11 +610,11 @@ __FOUND_WIDGET: cancel = control->onMouseEvent(control, gEvent_MouseMove); //if (data->acceptDrops() && gDrag::checkThreshold(data, gMouse::x(), gMouse::y(), gMouse::startX(), gMouse::startY())) - if ((event->motion.state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) + if (!cancel && (event->motion.state & (GDK_BUTTON1_MASK | GDK_BUTTON2_MASK | GDK_BUTTON3_MASK)) //&& (abs(gMouse::x() - gMouse::y()) + abs(gMouse::startX() - gMouse::startY())) > 8) && gDrag::checkThreshold(control, gMouse::x(), gMouse::y(), gMouse::startX(), gMouse::startY())) { - control->onMouseEvent(control, gEvent_MouseDrag); + cancel = control->onMouseEvent(control, gEvent_MouseDrag); } gMouse::invalidate(); @@ -1332,7 +1332,7 @@ int gApplication::getScrollbarSpacing() int gApplication::getInnerWidth() { if (strcmp(getStyleName(), "oxygen-gtk") == 0) - return 2; + return 1; else return 0; } @@ -1346,12 +1346,12 @@ int gApplication::getFrameWidth() GtkBorder border; gtk_style_context_get_padding(context, (GtkStateFlags)0, &tmp); - gtk_style_context_get_border(context, (GtkStateFlags)0, &border); + /*gtk_style_context_get_border(context, (GtkStateFlags)0, &border); tmp.top += border.top; tmp.right += border.right; tmp.bottom += border.bottom; - tmp.left += border.left; + tmp.left += border.left;*/ w = MIN(tmp.top, tmp.left); w = MIN(w, tmp.bottom);