From: Abdelrazak Younes Date: Thu, 15 May 2008 09:14:09 +0000 (+0000) Subject: Autoshow and autohide menubar while in fullscreen mode. X-Git-Tag: 1.6.10~4790 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a72c2056389ecf3cd0618b913803b5fcf19fb41c;p=features.git Autoshow and autohide menubar while in fullscreen mode. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24785 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 2711b4826a..3c4b710e17 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -641,12 +641,19 @@ bool GuiView::event(QEvent * e) } case QEvent::ShortcutOverride: { + QKeyEvent * ke = static_cast(e); + + if (ke->modifiers() & Qt::AltModifier && isFullScreen() + && menuBar()->isHidden()) { + menuBar()->show(); + // Continue with even. + return QMainWindow::event(e); + } + if (d.current_work_area_) // Nothing special to do. return QMainWindow::event(e); - QKeyEvent * ke = static_cast(e); - // Let Qt handle menu access and the Tab keys to navigate keys to navigate // between controls. if (ke->modifiers() & Qt::AltModifier || ke->key() == Qt::Key_Tab @@ -1670,10 +1677,11 @@ bool GuiView::closeBuffer(Buffer & buf, bool tolastopened) bool GuiView::dispatch(FuncRequest const & cmd) { - BufferView * bv = view(); + BufferView * bv = view(); // By default we won't need any update. if (bv) bv->cursor().updateFlags(Update::None); + bool dispatched = true; switch(cmd.action) { case LFUN_BUFFER_IMPORT: @@ -1903,10 +1911,18 @@ bool GuiView::dispatch(FuncRequest const & cmd) break; default: - return false; + dispatched = false; + break; } - return true; + if (isFullScreen()) { + if (menuBar()->isVisible()) + menuBar()->hide(); + if (statusBar()->isVisible()) + statusBar()->hide(); + } + + return dispatched; }