Restoring autohiding and showing of menubar upon Pavel's request.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24788 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-05-15 11:02:23 +00:00
parent 40f50f2a94
commit e5b6e5c58b

View File

@ -663,9 +663,15 @@ bool GuiView::event(QEvent * e)
if (!(ke->modifiers() & Qt::AltModifier)
|| ke->key() == Qt::Key_Alt)
return QMainWindow::event(e);
static_cast<MenuBar *>(menuBar())->keyPressEvent(ke);
MenuBar * menu_bar = static_cast<MenuBar *>(menuBar());
menu_bar->keyPressEvent(ke);
menu_bar->show();
if (ke->isAccepted())
return true;
// Showing and hiding the menubar has the potential to create a bad
// flickering due to the window resizing. On Windows Vista, this flicker
// is not visible at all.
menu_bar->hide();
// Otherwise continue with even.
return QMainWindow::event(e);
}
@ -1937,6 +1943,13 @@ bool GuiView::dispatch(FuncRequest const & cmd)
break;
}
if (isFullScreen()) {
if (menuBar()->isVisible())
menuBar()->hide();
if (statusBar()->isVisible())
statusBar()->hide();
}
return dispatched;
}