diff options
Diffstat (limited to 'src/server/connectionframe')
-rw-r--r-- | src/server/connectionframe/connectionframe.cpp | 23 | ||||
-rw-r--r-- | src/server/connectionframe/connectionframe.h | 2 |
2 files changed, 15 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); + } } } diff --git a/src/server/connectionframe/connectionframe.h b/src/server/connectionframe/connectionframe.h index 9898460..367810c 100644 --- a/src/server/connectionframe/connectionframe.h +++ b/src/server/connectionframe/connectionframe.h @@ -31,6 +31,8 @@ private: bool _selected; bool _isTutor; + static const int _startDragDistance = 40; + void showDefaultThumb(); void updateAppearance(); QLabel* addIcon(const QIcon* icon); |