From b5d74c26e0126b401ad118fe382720f1cdf2b3bf Mon Sep 17 00:00:00 2001 From: Klaus Basan Date: Fri, 6 Nov 2015 03:15:55 +0100 Subject: [PATCH] Fixed minimize/normal window states to support "normal" windows as well --- src/swiftguistandard/swiftguistd.cpp | 6 ++++-- src/swiftguistandard/swiftguistd.h | 6 +++--- src/swiftguistandard/swiftguistd_menus.cpp | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/swiftguistandard/swiftguistd.cpp b/src/swiftguistandard/swiftguistd.cpp index eebe4c5b1..7021ac564 100644 --- a/src/swiftguistandard/swiftguistd.cpp +++ b/src/swiftguistandard/swiftguistd.cpp @@ -124,6 +124,8 @@ void SwiftGuiStd::changeEvent(QEvent *event) if (event->type() == QEvent::WindowStateChange) { // make sure a tool window is changed to Normal window so it is show in taskbar + // here we are already in transition state, so isMinimized means will be minimize right now + // this check here is needed if minimized is called from somewhere else than ps_showMinimized if (!this->isFrameless()) { bool toolWindow(this->isToolWindow()); @@ -394,13 +396,13 @@ void SwiftGuiStd::ps_onChangedMainInfoAreaFloating(bool floating) void SwiftGuiStd::ps_showMinimized() { - if (!this->isFrameless()) { toolToNormalWindow(); } + if (m_windowMode == CEnableForFramelessWindow::WindowTool) { this->toolToNormalWindow(); } this->showMinimized(); } void SwiftGuiStd::ps_showNormal() { - if (!this->isFrameless()) { normalToToolWindow(); } + if (m_windowMode == CEnableForFramelessWindow::WindowTool) { this->normalToToolWindow(); } this->showNormal(); } diff --git a/src/swiftguistandard/swiftguistd.h b/src/swiftguistandard/swiftguistd.h index 851dc72c2..d8750019b 100644 --- a/src/swiftguistandard/swiftguistd.h +++ b/src/swiftguistandard/swiftguistd.h @@ -57,8 +57,8 @@ public: //! \remarks keep the values in sync with the real tab indexes enum MainPageIndex { - MainPageInfoArea = 0, - MainPageLogin = 1, + MainPageInfoArea = 0, + MainPageLogin = 1, MainPageInternals = 2, MainPageInvisible = 3 }; @@ -113,7 +113,7 @@ private: bool m_init = false; BlackGui::CManagedStatusBar m_statusBar; BlackMisc::CLogSubscriber m_logSubscriber { this, &SwiftGuiStd::ps_displayStatusMessageInGui }; - BlackCore::CData m_setup {this}; //!< setup cache + BlackCore::CData m_setup {this}; //!< setup cache // contexts bool m_coreAvailable = false; diff --git a/src/swiftguistandard/swiftguistd_menus.cpp b/src/swiftguistandard/swiftguistd_menus.cpp index 60421350c..446372622 100644 --- a/src/swiftguistandard/swiftguistd_menus.cpp +++ b/src/swiftguistandard/swiftguistd_menus.cpp @@ -67,7 +67,7 @@ void SwiftGuiStd::ps_onMenuClicked() } else if (sender == this->ui->menu_WindowMinimize) { - this->showMinimized(); + this->ps_showMinimized(); } else if (sender == this->ui->menu_WindowToggleOnTop) {