From 58170cb60127401d33a4726ea3f5d0d88006c62a Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Mon, 19 Jan 2009 19:15:23 +0000 Subject: [PATCH] Backport SVN commit 913715 by pino: KXmlGuiWindow is smart and tracks the visibility of toolbars and menubar, so just show/hide those directly instead of triggers their actions. This should fix hopefully for all their toggling, also between various runs. svn path=/branches/KDE/4.2/kdegraphics/okular/; revision=913717 --- shell/shell.cpp | 11 +++-------- shell/shell.h | 1 - 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/shell/shell.cpp b/shell/shell.cpp index 154d345a8..8f29ba03c 100644 --- a/shell/shell.cpp +++ b/shell/shell.cpp @@ -86,7 +86,6 @@ void Shell::init() // and integrate the part's GUI with the shell's setupGUI(Keys | ToolBar | Save); createGUI(m_part); - m_showToolBarAction = static_cast(toolBarMenuAction()); m_doc = qobject_cast(m_part); } @@ -277,12 +276,10 @@ void Shell::slotUpdateFullScreen() { if(m_fullScreenAction->isChecked()) { - m_menuBarWasShown = m_showMenuBarAction->isChecked(); - m_showMenuBarAction->setChecked(false); + m_menuBarWasShown = !menuBar()->isHidden(); menuBar()->hide(); - m_toolBarWasShown = m_showToolBarAction->isChecked(); - m_showToolBarAction->setChecked(false); + m_toolBarWasShown = !toolBar()->isHidden(); toolBar()->hide(); KToggleFullScreenAction::setFullScreen(this, true); @@ -291,12 +288,10 @@ void Shell::slotUpdateFullScreen() { if (m_menuBarWasShown) { - m_showMenuBarAction->setChecked(true); menuBar()->show(); } if (m_toolBarWasShown) { - m_showToolBarAction->setChecked(true); toolBar()->show(); } KToggleFullScreenAction::setFullScreen(this, false); @@ -305,7 +300,7 @@ void Shell::slotUpdateFullScreen() void Shell::slotShowMenubar() { - if ( m_showMenuBarAction->isChecked() ) + if ( menuBar()->isHidden() ) menuBar()->show(); else menuBar()->hide(); diff --git a/shell/shell.h b/shell/shell.h index fe4278dbf..628aff1c0 100644 --- a/shell/shell.h +++ b/shell/shell.h @@ -100,7 +100,6 @@ private: KAction* m_printAction; KToggleAction* m_fullScreenAction; KToggleAction* m_showMenuBarAction; - KToggleAction* m_showToolBarAction; bool m_menuBarWasShown, m_toolBarWasShown; KUrl m_openUrl; };