Skip to content

Commit

Permalink
Fix menuBar reappearing after switching from fullscreen to normal mode
Browse files Browse the repository at this point in the history
  • Loading branch information
fnkkio committed Nov 9, 2019
1 parent a3c73ca commit 6b6e0a6
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions src/ui/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1006,18 +1006,20 @@ void MainWindow::triggerAction(int identifier, const QVariantMap &parameters, 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;
Expand Down Expand Up @@ -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(m_toolBarStates[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(m_toolBarStates[ToolBarsManager::StatusBar].getVisibility(mode) == Session::MainWindow::ToolBarState::AlwaysVisibleToolBar);
}

if (!windowState().testFlag(Qt::WindowFullScreen))
Expand Down

0 comments on commit 6b6e0a6

Please sign in to comment.