Menubar autohiding: add some more comments and hide it a bit earlier.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24797 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-05-16 08:11:37 +00:00
parent 513c880f8d
commit fc22b68e37
2 changed files with 9 additions and 7 deletions

View File

@ -645,7 +645,9 @@ bool GuiView::event(QEvent * e)
if (isFullScreen() && menuBar()->isHidden()) { if (isFullScreen() && menuBar()->isHidden()) {
QKeyEvent * ke = static_cast<QKeyEvent*>(e); QKeyEvent * ke = static_cast<QKeyEvent*>(e);
// FIXME: we should also try to detect special LyX shortcut such as // FIXME: we should also try to detect special LyX shortcut such as
// Alt-P and Alt-M // Alt-P and Alt-M. Right now there is a hack in
// GuiWorkArea::processKeySym() that hides again the menubar for
// those cases.
if (ke->modifiers() & Qt::AltModifier && ke->key() != Qt::Key_Alt) if (ke->modifiers() & Qt::AltModifier && ke->key() != Qt::Key_Alt)
menuBar()->show(); menuBar()->show();
return QMainWindow::event(e); return QMainWindow::event(e);

View File

@ -407,17 +407,17 @@ void GuiWorkArea::redraw()
void GuiWorkArea::processKeySym(KeySymbol const & key, KeyModifier mod) void GuiWorkArea::processKeySym(KeySymbol const & key, KeyModifier mod)
{ {
if (lyx_view_->isFullScreen() && lyx_view_->menuBar()->isVisible()) {
// FIXME HACK: we should not have to do this here. See related comment
// in GuiView::event() (QEvent::ShortcutOverride)
lyx_view_->menuBar()->hide();
}
// In order to avoid bad surprise in the middle of an operation, // In order to avoid bad surprise in the middle of an operation,
// we better stop the blinking cursor... // we better stop the blinking cursor...
// the cursor gets restarted in GuiView::restartCursor() // the cursor gets restarted in GuiView::restartCursor()
stopBlinkingCursor(); stopBlinkingCursor();
if (lyx_view_->isFullScreen() && lyx_view_->menuBar()->isVisible()) {
// FIXME: we should not have to do this here. See related comment in
// GuiView::event().
lyx_view_->menuBar()->hide();
}
theLyXFunc().setLyXView(lyx_view_); theLyXFunc().setLyXView(lyx_view_);
theLyXFunc().processKeySym(key, mod); theLyXFunc().processKeySym(key, mod);
} }