Fix issue where the menu status for View menubar is not correct.

BUG: 181345

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=1133041
This commit is contained in:
Kurt Hindenburg
2010-06-01 00:05:41 +00:00
parent 1708547e64
commit b2939c262e
2 changed files with 15 additions and 1 deletions

View File

@@ -267,7 +267,6 @@ void MainWindow::setupActions()
// View Menu
_toggleMenuBarAction = KStandardAction::showMenubar(menuBar(), SLOT(setVisible(bool)), collection);
_toggleMenuBarAction->setShortcut( QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_M) );
_toggleMenuBarAction->setChecked( !menuBar()->isHidden() );
// Hide the Show/Hide menubar item if the menu bar is a MacOS-style menu bar
if ( menuBar()->isTopLevelMenu() )
@@ -504,5 +503,17 @@ void MainWindow::configureNotifications()
KNotifyConfigWidget::configure( this );
}
void MainWindow::showEvent(QShowEvent *event)
{
// This code from Konqueror.
// We need to check if our toolbars are shown/hidden here, and set
// our menu items accordingly. We can't do it in the constructor because
// view profiles store toolbar info, and that info is read after
// construct time.
_toggleMenuBarAction->setChecked( !menuBar()->isHidden() );
// Call parent method
KXmlGuiWindow::showEvent(event);
}
#include "MainWindow.moc"