Fix ScrollBarAsNeeded

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25338 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-06-20 13:29:25 +00:00
parent 2a1b0968cb
commit c75ff524bf

View File

@ -314,7 +314,7 @@ GuiWorkArea::~GuiWorkArea()
void GuiWorkArea::fixVerticalScrollBar()
{
if (!isFullScreen())
setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
}
@ -569,13 +569,13 @@ void GuiWorkArea::toggleCursor()
void GuiWorkArea::updateScrollbar()
{
ScrollbarParameters const & scroll_ = buffer_view_->scrollbarParameters();
// Block the scrollbar signal to prevent recursive signal/slot calling.
verticalScrollBar()->blockSignals(true);
// WARNING: don't touch at the scrollbar value like this:
// verticalScrollBar()->setValue(scroll_.position);
// because this would cause a recursive signal/slot calling with
// GuiWorkArea::scrollTo
verticalScrollBar()->setRange(scroll_.min, scroll_.max);
verticalScrollBar()->setPageStep(scroll_.page_step);
verticalScrollBar()->setSingleStep(scroll_.single_step);
verticalScrollBar()->setValue(scroll_.position);
verticalScrollBar()->setSliderPosition(scroll_.position);
verticalScrollBar()->blockSignals(false);
}