add a hack to autohide the menubar in fullscreen mode for LyX specific shortcuts beginning with Alt.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24795 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-05-15 23:55:00 +00:00
parent 34dc63da87
commit eadef99854
2 changed files with 7 additions and 1 deletions

View File

@ -646,7 +646,7 @@ bool GuiView::event(QEvent * e)
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
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

@ -411,6 +411,12 @@ void GuiWorkArea::processKeySym(KeySymbol const & key, KeyModifier mod)
// 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);
} }