summaryrefslogtreecommitdiffstats
path: root/src/server/connectionframe/connectionframe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/connectionframe/connectionframe.cpp')
-rw-r--r--src/server/connectionframe/connectionframe.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/src/server/connectionframe/connectionframe.cpp b/src/server/connectionframe/connectionframe.cpp
index f5739ee..7d9376c 100644
--- a/src/server/connectionframe/connectionframe.cpp
+++ b/src/server/connectionframe/connectionframe.cpp
@@ -131,16 +131,19 @@ void ConnectionFrame::mouseReleaseEvent(QMouseEvent* event)
event->accept();
if (event->button() == Qt::LeftButton)
{
- QApplication::setOverrideCursor(QCursor(Qt::OpenHandCursor));
- if (this->pos() != _previousPosition) {
- qDebug("Moved");
- emit frameMoved(this);
- }
- else
- {
- qDebug("Clicked");
- emit clicked(this);
- }
+ QApplication::setOverrideCursor(QCursor(Qt::OpenHandCursor));
+ // Only recognize a move if the distance is larger than _startDragDistance
+ if ((this->pos() - _previousPosition).manhattanLength() > _startDragDistance )
+ {
+ qDebug("Moved");
+ emit frameMoved(this);
+ }
+ else
+ {
+ qDebug("Clicked");
+ move(_previousPosition);
+ emit clicked(this);
+ }
}
}