mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
Improve fullscreen capabilities ( http://bugzilla.lyx.org/show_bug.cgi?id=4146 ).
- adding frames, adding fullscreen switch. - LFUN_MENUBAR_TOGGLE, LFUN_STATUSBAR_TOGGLE -> LFUN_UI_TOGGLE. There are still limitations wrt Outlining in MAC OS - someone could check, see http://www.nabble.com/Fullscreen-mode-to15314676.html#a15367830 . git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22893 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
bd8cba506f
commit
b9cf09838f
@ -1104,23 +1104,19 @@ void LyXAction::init()
|
|||||||
{ LFUN_TOOLBAR_TOGGLE, "toolbar-toggle", NoBuffer, Buffer },
|
{ LFUN_TOOLBAR_TOGGLE, "toolbar-toggle", NoBuffer, Buffer },
|
||||||
{ LFUN_MENU_OPEN, "menu-open", NoBuffer, Buffer },
|
{ LFUN_MENU_OPEN, "menu-open", NoBuffer, Buffer },
|
||||||
/*!
|
/*!
|
||||||
* \var lyx::kb_action lyx::LFUN_MENUBAR_TOGGLE
|
* \var lyx::kb_action lyx::LFUN_UI_TOGGLE
|
||||||
* \li Action: Toggles visibility of the main menu.
|
* \li Action: Various UI visibility-toggling actions.
|
||||||
* \li Notion: This can be used for the fullscreen mode.
|
* \li Syntax: ui-toggle <statusbar|menubar|frame|fullscreen>
|
||||||
* \li Syntax: menubar-toggle
|
* \li Params: statusbar : Toggle visibility of the statusbar.\n
|
||||||
* \li Origin: ps, 6 Feb 2008
|
menubar : Toggle visibility of the menubar.\n
|
||||||
|
frame : Toggle visibility of the frames around editing window.\n
|
||||||
|
fullscreen : Toggle fullscreen mode. This also covers calling the
|
||||||
|
previous functions. However #LFUN_TOOLBAR_TOGGLE for the
|
||||||
|
custom tweaks of the toolbars should be used.
|
||||||
|
* \li Origin: ps, 9 Feb 2007
|
||||||
* \endvar
|
* \endvar
|
||||||
*/
|
*/
|
||||||
{ LFUN_MENUBAR_TOGGLE, "menubar-toggle", NoBuffer, Buffer },
|
{ LFUN_UI_TOGGLE, "ui-toggle", NoBuffer, Buffer },
|
||||||
/*!
|
|
||||||
* \var lyx::kb_action lyx::LFUN_STATUSBAR_TOGGLE
|
|
||||||
* \li Action: Toggles visibility of the main menu.
|
|
||||||
* \li Notion: This can be used for the fullscreen mode.
|
|
||||||
* \li Syntax: statusbar-toggle
|
|
||||||
* \li Origin: ps, 6 Feb 2008
|
|
||||||
* \endvar
|
|
||||||
*/
|
|
||||||
{ LFUN_STATUSBAR_TOGGLE, "statusbar-toggle", NoBuffer, Buffer },
|
|
||||||
|
|
||||||
{ LFUN_WINDOW_NEW, "window-new", NoBuffer, Buffer },
|
{ LFUN_WINDOW_NEW, "window-new", NoBuffer, Buffer },
|
||||||
{ LFUN_WINDOW_CLOSE, "window-close", NoBuffer, Buffer },
|
{ LFUN_WINDOW_CLOSE, "window-close", NoBuffer, Buffer },
|
||||||
|
@ -453,8 +453,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_TOOLBAR_TOGGLE:
|
case LFUN_TOOLBAR_TOGGLE:
|
||||||
case LFUN_MENUBAR_TOGGLE:
|
case LFUN_UI_TOGGLE:
|
||||||
case LFUN_STATUSBAR_TOGGLE:
|
|
||||||
case LFUN_INSET_APPLY:
|
case LFUN_INSET_APPLY:
|
||||||
case LFUN_BUFFER_WRITE:
|
case LFUN_BUFFER_WRITE:
|
||||||
case LFUN_BUFFER_WRITE_AS:
|
case LFUN_BUFFER_WRITE_AS:
|
||||||
|
@ -1800,13 +1800,48 @@ bool GuiView::dispatch(FuncRequest const & cmd)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case LFUN_MENUBAR_TOGGLE:
|
case LFUN_UI_TOGGLE: {
|
||||||
menuBar()->setVisible(!menuBar()->isVisible());
|
string const arg = cmd.getArg(0);
|
||||||
break;
|
if (arg == "statusbar")
|
||||||
|
|
||||||
case LFUN_STATUSBAR_TOGGLE:
|
|
||||||
statusBar()->setVisible(!statusBar()->isVisible());
|
statusBar()->setVisible(!statusBar()->isVisible());
|
||||||
|
else if (arg == "menubar")
|
||||||
|
menuBar()->setVisible(!menuBar()->isVisible());
|
||||||
|
#if QT_VERSION >= 0x040300
|
||||||
|
else if (arg == "frame") {
|
||||||
|
int l, t, r, b;
|
||||||
|
getContentsMargins(&l, &t, &r, &b);
|
||||||
|
//are the frames in default state?
|
||||||
|
if (l == 0) {
|
||||||
|
d.current_work_area_->setFrameStyle(QFrame::NoFrame);
|
||||||
|
setContentsMargins(-2, -2, -2, -2);
|
||||||
|
} else {
|
||||||
|
d.current_work_area_->setFrameStyle(QFrame::NoFrame);
|
||||||
|
setContentsMargins(0, 0, 0, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
else if (arg == "fullscreen") {
|
||||||
|
if (isFullScreen()) {
|
||||||
|
showNormal();
|
||||||
|
#if QT_VERSION >= 0x040300
|
||||||
|
setContentsMargins(0, 0, 0, 0);
|
||||||
|
#endif
|
||||||
|
d.current_work_area_->setFrameStyle(QFrame::NoFrame);
|
||||||
|
menuBar()->show();
|
||||||
|
statusBar()->show();
|
||||||
|
} else {
|
||||||
|
statusBar()->hide();
|
||||||
|
menuBar()->hide();
|
||||||
|
d.current_work_area_->setFrameStyle(QFrame::NoFrame);
|
||||||
|
#if QT_VERSION >= 0x040300
|
||||||
|
setContentsMargins(-2, -2, -2, -2);
|
||||||
|
#endif
|
||||||
|
showFullScreen();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -413,9 +413,7 @@ enum kb_action {
|
|||||||
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
|
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
|
||||||
LFUN_IN_MATHMACROTEMPLATE,
|
LFUN_IN_MATHMACROTEMPLATE,
|
||||||
LFUN_SCROLL,
|
LFUN_SCROLL,
|
||||||
LFUN_MENUBAR_TOGGLE,
|
LFUN_UI_TOGGLE,
|
||||||
LFUN_STATUSBAR_TOGGLE,
|
|
||||||
// 320
|
|
||||||
LFUN_LASTACTION // end of the table
|
LFUN_LASTACTION // end of the table
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user