From eadef99854aac4c93412240b7a683d08d950147c Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 15 May 2008 23:55:00 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiView.cpp | 2 +- src/frontends/qt4/GuiWorkArea.cpp | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index eae6bf1357..79f80908c2 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -646,7 +646,7 @@ bool GuiView::event(QEvent * e) QKeyEvent * ke = static_cast(e); // FIXME: we should also try to detect special LyX shortcut such as // 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(); return QMainWindow::event(e); } diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index e4ca81fc16..2525acd679 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -411,6 +411,12 @@ void GuiWorkArea::processKeySym(KeySymbol const & key, KeyModifier mod) // the cursor gets restarted in GuiView::restartCursor() 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().processKeySym(key, mod); } -- 2.39.5