From fc22b68e374e3e73de856d6a0ab94caf2b73d5bd Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Fri, 16 May 2008 08:11:37 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiView.cpp | 4 +++- src/frontends/qt4/GuiWorkArea.cpp | 12 ++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 79f80908c2..62207b7c8a 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -645,7 +645,9 @@ bool GuiView::event(QEvent * e) if (isFullScreen() && menuBar()->isHidden()) { QKeyEvent * ke = static_cast(e); // 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) menuBar()->show(); return QMainWindow::event(e); diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index f89056d261..ca3cdb90ce 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -407,17 +407,17 @@ void GuiWorkArea::redraw() 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, // we better stop the blinking cursor... // 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