Fixed minimize/normal window states to support "normal" windows as well

This commit is contained in:
Klaus Basan
2015-11-06 03:15:55 +01:00
committed by Mathew Sutcliffe
parent 4268f9c347
commit b5d74c26e0
3 changed files with 8 additions and 6 deletions

View File

@@ -124,6 +124,8 @@ void SwiftGuiStd::changeEvent(QEvent *event)
if (event->type() == QEvent::WindowStateChange) if (event->type() == QEvent::WindowStateChange)
{ {
// make sure a tool window is changed to Normal window so it is show in taskbar // 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()) if (!this->isFrameless())
{ {
bool toolWindow(this->isToolWindow()); bool toolWindow(this->isToolWindow());
@@ -394,13 +396,13 @@ void SwiftGuiStd::ps_onChangedMainInfoAreaFloating(bool floating)
void SwiftGuiStd::ps_showMinimized() void SwiftGuiStd::ps_showMinimized()
{ {
if (!this->isFrameless()) { toolToNormalWindow(); } if (m_windowMode == CEnableForFramelessWindow::WindowTool) { this->toolToNormalWindow(); }
this->showMinimized(); this->showMinimized();
} }
void SwiftGuiStd::ps_showNormal() void SwiftGuiStd::ps_showNormal()
{ {
if (!this->isFrameless()) { normalToToolWindow(); } if (m_windowMode == CEnableForFramelessWindow::WindowTool) { this->normalToToolWindow(); }
this->showNormal(); this->showNormal();
} }

View File

@@ -67,7 +67,7 @@ void SwiftGuiStd::ps_onMenuClicked()
} }
else if (sender == this->ui->menu_WindowMinimize) else if (sender == this->ui->menu_WindowMinimize)
{ {
this->showMinimized(); this->ps_showMinimized();
} }
else if (sender == this->ui->menu_WindowToggleOnTop) else if (sender == this->ui->menu_WindowToggleOnTop)
{ {