From 2b4b4d721f1abd975cfe35d7f3a61e9ae414e833 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Wed, 15 Nov 2006 18:01:44 +0000 Subject: [PATCH] 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 --- src/frontends/qt4/GuiWorkArea.C | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/frontends/qt4/GuiWorkArea.C b/src/frontends/qt4/GuiWorkArea.C index b1c8d29f8f..5a1a44106e 100644 --- a/src/frontends/qt4/GuiWorkArea.C +++ b/src/frontends/qt4/GuiWorkArea.C @@ -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);