From 69233b77ff21f71aa90c16575de40925a186a932 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Mon, 29 Oct 2018 23:12:24 +0300 Subject: [PATCH] Fixed Unmaximize button in title bar for Windows. (#845) * Fixed Unmaximize button in title bar for Windows. * Clang-formated BaseWindow.cpp. --- src/widgets/BaseWindow.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/widgets/BaseWindow.cpp b/src/widgets/BaseWindow.cpp index fc22c1eda..440935ea3 100644 --- a/src/widgets/BaseWindow.cpp +++ b/src/widgets/BaseWindow.cpp @@ -125,13 +125,14 @@ void BaseWindow::init() this->setWindowState(Qt::WindowMinimized | this->windowState()); }); - QObject::connect( - _maxButton, &TitleBarButton::leftClicked, this, [this] { - this->setWindowState(this->windowState() == - Qt::WindowMaximized - ? Qt::WindowActive - : Qt::WindowMaximized); - }); + QObject::connect(_maxButton, &TitleBarButton::leftClicked, this, + [this, _maxButton] { + this->setWindowState( + _maxButton->getButtonStyle() != + TitleBarButtonStyle::Maximize + ? Qt::WindowActive + : Qt::WindowMaximized); + }); QObject::connect(_exitButton, &TitleBarButton::leftClicked, this, [this] { this->close(); });