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(); });