diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-07-11 11:21:44 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-07-11 11:21:16 +0000 |
commit | c5617da5fd563e5bf1894a2b0303ae3ae835e20d (patch) | |
tree | be1a50b6e339a253e5e9ab4625b20edc25a47935 /src/quicktemplates2 | |
parent | 3a7d3a8aa90e2b26a98eff1df0b93965976a699d (diff) |
Drawer: fix dragMargin handling
Change-Id: I7549509aef9a88af7e6a449bae52da273b0253d0
Task-number: QTBUG-54629
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquickdrawer.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickdrawer.cpp b/src/quicktemplates2/qquickdrawer.cpp index 0f45a96b..c165b077 100644 --- a/src/quicktemplates2/qquickdrawer.cpp +++ b/src/quicktemplates2/qquickdrawer.cpp @@ -244,10 +244,12 @@ bool QQuickDrawerPrivate::handleMouseMoveEvent(QQuickItem *item, QMouseEvent *ev // larger threshold to avoid being too eager to steal touch (QTBUG-50045) int threshold = qMax(20, QGuiApplication::styleHints()->startDragDistance() + 5); bool overThreshold = false; - if (edge == Qt::LeftEdge || edge == Qt::RightEdge) - overThreshold = dragOverThreshold(movePoint.x() - pressPoint.x(), Qt::XAxis, event, threshold); - else - overThreshold = dragOverThreshold(movePoint.y() - pressPoint.y(), Qt::YAxis, event, threshold); + if (position > 0 || dragMargin > 0) { + if (edge == Qt::LeftEdge || edge == Qt::RightEdge) + overThreshold = dragOverThreshold(movePoint.x() - pressPoint.x(), Qt::XAxis, event, threshold); + else + overThreshold = dragOverThreshold(movePoint.y() - pressPoint.y(), Qt::YAxis, event, threshold); + } // Don't be too eager to steal presses outside the drawer (QTBUG-53929) if (overThreshold && qFuzzyCompare(position, qreal(1.0)) && !popupItem->contains(popupItem->mapFromScene(movePoint))) { |