From 842ec06ce62f6c7d5dc8f2cce68722c905cc7429 Mon Sep 17 00:00:00 2001 From: Stefan Comanescu Date: Sat, 9 Nov 2019 15:54:55 +0200 Subject: [PATCH] Fix menuBar reappearing after switching from fullscreen to normal mode --- src/ui/MainWindow.cpp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/ui/MainWindow.cpp b/src/ui/MainWindow.cpp index 5a7402bf0a..914fe5ba9d 100644 --- a/src/ui/MainWindow.cpp +++ b/src/ui/MainWindow.cpp @@ -1006,18 +1006,20 @@ void MainWindow::triggerAction(int identifier, const QVariantMap ¶meters, Ac break; case ToolBarsManager::StatusBar: - if (isChecked && !m_statusBar) + if (isChecked && (!m_statusBar || !m_statusBar->isVisible())) { - m_statusBar = new StatusBarWidget(this); + if (!m_statusBar) + { + m_statusBar = new StatusBarWidget(this); + + setStatusBar(m_statusBar); + } - setStatusBar(m_statusBar); + m_statusBar->show(); } - else if (!isChecked && m_statusBar) + else if (!isChecked && (m_statusBar && m_statusBar->isVisible())) { - m_statusBar->deleteLater(); - m_statusBar = nullptr; - - setStatusBar(nullptr); + m_statusBar->hide(); } break; @@ -2717,12 +2719,12 @@ bool MainWindow::event(QEvent *event) if (m_menuBar) { - m_menuBar->setVisible(ToolBarsManager::getToolBarDefinition(ToolBarsManager::MenuBar).getVisibility(mode) == ToolBarsManager::AlwaysVisibleToolBar); + m_menuBar->setVisible(getToolBarState(ToolBarsManager::MenuBar).getVisibility(mode) == Session::MainWindow::ToolBarState::AlwaysVisibleToolBar); } if (m_statusBar) { - m_statusBar->setVisible(ToolBarsManager::getToolBarDefinition(ToolBarsManager::StatusBar).getVisibility(mode) == ToolBarsManager::AlwaysVisibleToolBar); + m_statusBar->setVisible(getToolBarState(ToolBarsManager::StatusBar).getVisibility(mode) == Session::MainWindow::ToolBarState::AlwaysVisibleToolBar); } if (!windowState().testFlag(Qt::WindowFullScreen))