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
remotes/origin/KDE/4.2
Pino Toscano 17 years ago
parent d211188560
commit 58170cb601
  1. 11
      shell/shell.cpp
  2. 1
      shell/shell.h

@ -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<KToggleAction*>(toolBarMenuAction());
m_doc = qobject_cast<KDocumentViewer*>(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();

@ -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;
};

Loading…
Cancel
Save