From 96c7f9314c4ef181c8a55f3e0aad0cfefb608e18 Mon Sep 17 00:00:00 2001 From: Arthur Pichlkostner Date: Tue, 9 Oct 2018 13:11:26 +0200 Subject: [PATCH] Fix: user settings for gui not saved after program is closed Summary: When the player switches to full screen mode the settings for the visibility of menubar, toolbar and statusbar are set to fixed values and the user settings are saved in backup variables. These backup values are restored when the player is closed. If the player is not in full screen mode, the backup variable have default values and the user settings are overwritten. Solution: Restore settings only when the window is in fullscreen mode. BUG: 376961 Reviewers: sitter Reviewed By: sitter Differential Revision: https://phabricator.kde.org/D15594 --- src/app/mainWindow.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/app/mainWindow.cpp b/src/app/mainWindow.cpp index 3f21294..7784d6b 100644 --- a/src/app/mainWindow.cpp +++ b/src/app/mainWindow.cpp @@ -245,11 +245,13 @@ MainWindow::~MainWindow() void MainWindow::closeEvent (QCloseEvent *event) { - // Restore the state of these before closing mainWindow()->setWindowState( Qt::WindowNoState ); - statusBar()->setHidden( m_statusbarIsHidden ); - toolBar()->setHidden( m_toolbarIsHidden ); - menuBar()->setHidden( m_menuBarIsHidden ); + // restore the following user ui settings which are changed in full screen mode + if (mainWindow()->isFullScreen()) { + statusBar()->setHidden( m_statusbarIsHidden ); + toolBar()->setHidden( m_toolbarIsHidden ); + menuBar()->setHidden( m_menuBarIsHidden ); + } KMainWindow::closeEvent( event ); } -- GitLab