disable scrollbar when not needed, this patch is totally uncritical

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15935 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2006-11-15 18:01:44 +00:00
parent 6e22254244
commit 2b4b4d721f

View File

@ -165,7 +165,7 @@ GuiWorkArea::GuiWorkArea(int w, int h, int id, LyXView & lyx_view)
cursor_ = new frontend::CursorWidget();
cursor_->hide();
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
setAcceptDrops(true);
setMinimumSize(100, 70);
@ -218,6 +218,9 @@ GuiWorkArea::GuiWorkArea(int w, int h, int id, LyXView & lyx_view)
void GuiWorkArea::setScrollbarParams(int h, int scroll_pos, int scroll_line_step)
{
if (verticalScrollBarPolicy() != Qt::ScrollBarAlwaysOn)
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
verticalScrollBar()->setTracking(false);
// do what cursor movement does (some grey)
@ -517,6 +520,8 @@ void GuiWorkArea::update(int x, int y, int w, int h)
void GuiWorkArea::doGreyOut(QLPainter & pain)
{
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
pain.fillRectangle(0, 0, width(), height(),
LColor::bottomarea);