ui-toggle lfun tweaks.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22950 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Pavel Sanda 2008-02-11 23:52:25 +00:00
parent 9600fb1aaf
commit a05f041470
2 changed files with 14 additions and 0 deletions

View File

@ -1109,6 +1109,7 @@ void LyXAction::init()
* \li Syntax: ui-toggle <statusbar|menubar|frame|fullscreen>
* \li Params: statusbar : Toggle visibility of the statusbar.\n
menubar : Toggle visibility of the menubar.\n
scrollbar : Toggle visibility of the scrollbar.\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

View File

@ -84,6 +84,7 @@
#include <QTimer>
#include <QToolBar>
#include <QUrl>
#include <QScrollBar>
#include <boost/assert.hpp>
#include <boost/bind.hpp>
@ -1815,6 +1816,18 @@ bool GuiView::dispatch(FuncRequest const & cmd)
void GuiView::lfunUiToggle(FuncRequest const & cmd)
{
string const arg = cmd.getArg(0);
if (arg == "scrollbar") {
// hide() is of no help
if (d.current_work_area_->verticalScrollBarPolicy() ==
Qt::ScrollBarAlwaysOff)
d.current_work_area_->setVerticalScrollBarPolicy(
Qt::ScrollBarAsNeeded);
else
d.current_work_area_->setVerticalScrollBarPolicy(
Qt::ScrollBarAlwaysOff);
return;
}
if (arg == "statusbar") {
statusBar()->setVisible(!statusBar()->isVisible());
return;