From e5b6e5c58bae52b00ff293f44ccf511ec01a1e34 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Thu, 15 May 2008 11:02:23 +0000 Subject: [PATCH] Restoring autohiding and showing of menubar upon Pavel's request. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24788 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 10a7a57a96..6a682cfc66 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -663,9 +663,15 @@ bool GuiView::event(QEvent * e) if (!(ke->modifiers() & Qt::AltModifier) || ke->key() == Qt::Key_Alt) return QMainWindow::event(e); - static_cast(menuBar())->keyPressEvent(ke); + MenuBar * menu_bar = static_cast(menuBar()); + menu_bar->keyPressEvent(ke); + menu_bar->show(); if (ke->isAccepted()) return true; + // Showing and hiding the menubar has the potential to create a bad + // flickering due to the window resizing. On Windows Vista, this flicker + // is not visible at all. + menu_bar->hide(); // Otherwise continue with even. return QMainWindow::event(e); } @@ -1937,6 +1943,13 @@ bool GuiView::dispatch(FuncRequest const & cmd) break; } + if (isFullScreen()) { + if (menuBar()->isVisible()) + menuBar()->hide(); + if (statusBar()->isVisible()) + statusBar()->hide(); + } + return dispatched; }