From a05f041470f90e8e2a3cd1190a435821376ee1a8 Mon Sep 17 00:00:00 2001 From: Pavel Sanda Date: Mon, 11 Feb 2008 23:52:25 +0000 Subject: [PATCH] ui-toggle lfun tweaks. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22950 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/LyXAction.cpp | 1 + src/frontends/qt4/GuiView.cpp | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index ac3c906f9d..321d38f50f 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -1109,6 +1109,7 @@ void LyXAction::init() * \li Syntax: ui-toggle * \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 diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index ffda79e6d7..17fa83bd29 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -84,6 +84,7 @@ #include #include #include +#include #include #include @@ -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;