]> git.lyx.org Git - features.git/commitdiff
Menubar autohiding: add some more comments and hide it a bit earlier.
authorAbdelrazak Younes <younes@lyx.org>
Fri, 16 May 2008 08:11:37 +0000 (08:11 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 16 May 2008 08:11:37 +0000 (08:11 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24797 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiWorkArea.cpp

index 79f80908c2825c82580a60e8daebf0bc237ae28f..62207b7c8a9bdd5fd9cc4c20fa8cff554dd2674a 100644 (file)
@@ -645,7 +645,9 @@ bool GuiView::event(QEvent * e)
                if (isFullScreen() && menuBar()->isHidden()) {
                        QKeyEvent * ke = static_cast<QKeyEvent*>(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);
index f89056d261a27fdb657868fd60cf3497c828fb16..ca3cdb90ce7bb7923dc55560e56648baa7bd074c 100644 (file)
@@ -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);
 }