summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client/toolbar/toolbar.cpp13
-rw-r--r--src/client/toolbar/toolbar.h5
2 files changed, 17 insertions, 1 deletions
diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp
index a3e2c31..af885fd 100644
--- a/src/client/toolbar/toolbar.cpp
+++ b/src/client/toolbar/toolbar.cpp
@@ -240,6 +240,19 @@ void Toolbar::enterEvent(QEvent* e)
QWidget::enterEvent(e);
}
+void Toolbar::mousePressEvent(QMouseEvent* e)
+{
+ _lastDragPos = e->globalPos();
+}
+
+void Toolbar::mouseMoveEvent(QMouseEvent* e)
+{
+ const QPoint currentPos = e->globalPos();
+ const QPoint offset = currentPos - _lastDragPos;
+ _lastDragPos = currentPos;
+ move(x() + offset.x(), y());
+}
+
/*
* CFG to test this
* http://git.openslx.org/tm-scripts.git/plain/server/modules/pvs2-freiburg/etc/xdg/openslx/pvs2client.ini
diff --git a/src/client/toolbar/toolbar.h b/src/client/toolbar/toolbar.h
index fd1d993..7826499 100644
--- a/src/client/toolbar/toolbar.h
+++ b/src/client/toolbar/toolbar.h
@@ -57,10 +57,13 @@ private:
VncWindow *_vnc;
bool _isManagerPc;
const QPixmap _cam32, _beWatchedEye;
+ QPoint _lastDragPos;
int centerPos, yPos, yPosHidden;
- void enterEvent(QEvent* e);
+ void enterEvent(QEvent* e) override;
+ void mousePressEvent(QMouseEvent* event) override;
+ void mouseMoveEvent(QMouseEvent* event) override;
QList<Room> myRooms();
bool isManagerPc();
QString identifyMgrIP();