diff options
author | Simon Rettberg | 2018-09-04 14:13:43 +0200 |
---|---|---|
committer | Simon Rettberg | 2018-09-04 14:13:56 +0200 |
commit | 3b282ab50351ec11cdfd1b3baaf3433d74f00958 (patch) | |
tree | bbeb2d5afaebc3ce513db4aaca07803e611cd1b3 /src | |
parent | [client] Make toolbar movable by mouse (diff) | |
download | pvs2-3b282ab50351ec11cdfd1b3baaf3433d74f00958.tar.gz pvs2-3b282ab50351ec11cdfd1b3baaf3433d74f00958.tar.xz pvs2-3b282ab50351ec11cdfd1b3baaf3433d74f00958.zip |
[client] Fix code style
Diffstat (limited to 'src')
-rw-r--r-- | src/client/toolbar/toolbar.cpp | 16 | ||||
-rw-r--r-- | src/client/toolbar/toolbar.h | 3 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/client/toolbar/toolbar.cpp b/src/client/toolbar/toolbar.cpp index af885fd..0769f57 100644 --- a/src/client/toolbar/toolbar.cpp +++ b/src/client/toolbar/toolbar.cpp @@ -448,7 +448,7 @@ void Toolbar::hideBar() if (--_hideCountdown > 0) return; _hideTimer.stop(); - move(x(), yPosHidden); + move(x(), _yPosHidden); } void Toolbar::delayedHideBar() @@ -465,7 +465,7 @@ void Toolbar::delayedHideBar() */ void Toolbar::showBar() { - move(x(), yPos); + move(x(), _yPos); delayedHideBar(); } @@ -551,18 +551,18 @@ void Toolbar::setToolbarPosition(const QRect &availableGeometry) { const QRect primaryScreen = QGuiApplication::primaryScreen()->geometry(); // set center position - centerPos = primaryScreen.left() + (primaryScreen.width() - this->width()) / 2; + const int centerPos = primaryScreen.left() + (primaryScreen.width() - this->width()) / 2; // detect system task bars if (primaryScreen.height() > availableGeometry.height() && primaryScreen.y() < availableGeometry.y()) { // system task bar already in top position, prefer to show toolbar on bottom - yPos = primaryScreen.height() - this->height(); - yPosHidden = primaryScreen.height() - 2; + _yPos = primaryScreen.height() - this->height(); + _yPosHidden = primaryScreen.height() - 2; } else { // no task bars at all or a bottom task bar, either way show our toolbar on top - yPos = primaryScreen.top(); - yPosHidden = yPos - this->height() + 2; + _yPos = primaryScreen.top(); + _yPosHidden = _yPos - this->height() + 2; } - move(centerPos, yPos); + move(centerPos, _yPos); delayedShowBar(); } diff --git a/src/client/toolbar/toolbar.h b/src/client/toolbar/toolbar.h index 7826499..67e9347 100644 --- a/src/client/toolbar/toolbar.h +++ b/src/client/toolbar/toolbar.h @@ -59,7 +59,8 @@ private: const QPixmap _cam32, _beWatchedEye; QPoint _lastDragPos; - int centerPos, yPos, yPosHidden; + int _yPos; + int _yPosHidden; void enterEvent(QEvent* e) override; void mousePressEvent(QMouseEvent* event) override; |