- 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:
Pavel Sanda 2008-02-09 11:58:01 +00:00
parent bd8cba506f
commit b9cf09838f
4 changed files with 53 additions and 25 deletions

View File

@ -1104,23 +1104,19 @@ void LyXAction::init()
{ LFUN_TOOLBAR_TOGGLE, "toolbar-toggle", NoBuffer, Buffer },
{ LFUN_MENU_OPEN, "menu-open", NoBuffer, Buffer },
/*!
* \var lyx::kb_action lyx::LFUN_MENUBAR_TOGGLE
* \li Action: Toggles visibility of the main menu.
* \li Notion: This can be used for the fullscreen mode.
* \li Syntax: menubar-toggle
* \li Origin: ps, 6 Feb 2008
* \var lyx::kb_action lyx::LFUN_UI_TOGGLE
* \li Action: Various UI visibility-toggling actions.
* \li Syntax: ui-toggle <statusbar|menubar|frame|fullscreen>
* \li Params: statusbar : Toggle visibility of the statusbar.\n
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
*/
{ LFUN_MENUBAR_TOGGLE, "menubar-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_UI_TOGGLE, "ui-toggle", NoBuffer, Buffer },
{ LFUN_WINDOW_NEW, "window-new", NoBuffer, Buffer },
{ LFUN_WINDOW_CLOSE, "window-close", NoBuffer, Buffer },

View File

@ -453,8 +453,7 @@ FuncStatus LyXFunc::getStatus(FuncRequest const & cmd) const
break;
case LFUN_TOOLBAR_TOGGLE:
case LFUN_MENUBAR_TOGGLE:
case LFUN_STATUSBAR_TOGGLE:
case LFUN_UI_TOGGLE:
case LFUN_INSET_APPLY:
case LFUN_BUFFER_WRITE:
case LFUN_BUFFER_WRITE_AS:

View File

@ -1800,13 +1800,48 @@ bool GuiView::dispatch(FuncRequest const & cmd)
break;
}
case LFUN_MENUBAR_TOGGLE:
menuBar()->setVisible(!menuBar()->isVisible());
break;
case LFUN_UI_TOGGLE: {
string const arg = cmd.getArg(0);
if (arg == "statusbar")
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();
}
}
case LFUN_STATUSBAR_TOGGLE:
statusBar()->setVisible(!statusBar()->isVisible());
break;
}
default:
return false;

View File

@ -413,9 +413,7 @@ enum kb_action {
LFUN_MATH_MACRO_ADD_GREEDY_OPTIONAL_PARAM,
LFUN_IN_MATHMACROTEMPLATE,
LFUN_SCROLL,
LFUN_MENUBAR_TOGGLE,
LFUN_STATUSBAR_TOGGLE,
// 320
LFUN_UI_TOGGLE,
LFUN_LASTACTION // end of the table
};