Abdelrazak Younes wrote:
Abdelrazak Younes wrote:
Pavel Sanda wrote:
Sebastian Guttenberg wrote:
(and perhaps simple to implement?)
i don't know how to do it easily. also note that this fullscreen stuff
is more fragile part of code since every arch like win/linux/mac works
slightly different and every touch can work in other way in different
systems.
The Alt key handling is directly handled by Qt. The solution is to
catch this key in the same way we catch the Tab key in
GuiView::event() (see QEvent::ShortcutOverride). Then, if we are in
fullscreen mode _and_ the menubar is hidden _and_ the pressed key is
Alt, we should show the menubar.
This patch does exactly that. The problem is that the menubar is not
hidden again afterwards. Is that acceptable? If not, are you
interested in doing this last bit Pavel?
OK, never mind, I did it. But I just realized that this will also popup
the menubar for our private shortcuts using the Alt key (Alt-p, Alt-m,
Alt-Shift-m, etc). I'll see if we can avoid that.
Abdel.
Author: younes
Date: Thu May 15 11:14:09 2008
New Revision: 24785
URL: http://www.lyx.org/trac/changeset/24785
Log:
Autoshow and autohide menubar while in fullscreen mode.
Modified:
lyx-devel/trunk/src/frontends/qt4/GuiView.cpp
Modified: lyx-devel/trunk/src/frontends/qt4/GuiView.cpp
URL:
http://www.lyx.org/trac/file/lyx-devel/trunk/src/frontends/qt4/GuiView.cpp?rev=24785
==============================================================================
--- lyx-devel/trunk/src/frontends/qt4/GuiView.cpp (original)
+++ lyx-devel/trunk/src/frontends/qt4/GuiView.cpp Thu May 15 11:14:09 2008
@@ -641,11 +641,18 @@
}
case QEvent::ShortcutOverride: {
+ QKeyEvent * ke = static_cast<QKeyEvent*>(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<QKeyEvent*>(e);
// Let Qt handle menu access and the Tab keys to navigate keys
to navigate
// between controls.
@@ -1670,10 +1677,11 @@
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 @@
break;
default:
- return false;
- }
-
- return true;
+ dispatched = false;
+ break;
+ }
+
+ if (isFullScreen()) {
+ if (menuBar()->isVisible())
+ menuBar()->hide();
+ if (statusBar()->isVisible())
+ statusBar()->hide();
+ }
+
+ return dispatched;
}