X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Ffrontends%2Fqt4%2FGuiWorkArea.cpp;h=a61d31309a7026098bb4bbae0aeb23c74d7d74f1;hb=50de85396c785a454fe07b77d815c57f3e462282;hp=ec30f9b2d71fd01f593e01016efc82b97bcbe85f;hpb=cc4b9be8930debb4ba91d2b859539197c5306551;p=lyx.git diff --git a/src/frontends/qt4/GuiWorkArea.cpp b/src/frontends/qt4/GuiWorkArea.cpp index ec30f9b2d7..a61d31309a 100644 --- a/src/frontends/qt4/GuiWorkArea.cpp +++ b/src/frontends/qt4/GuiWorkArea.cpp @@ -241,9 +241,22 @@ void GuiWorkArea::setScrollbarParams(int h, int scroll_pos, int scroll_line_step } -void GuiWorkArea::adjustViewWithScrollBar(int) +void GuiWorkArea::adjustViewWithScrollBar(int action) { - scrollBufferView(verticalScrollBar()->sliderPosition()); + stopBlinkingCursor(); + if (action == QAbstractSlider::SliderPageStepAdd) + buffer_view_->scrollDown(viewport()->height()); + else if (action == QAbstractSlider::SliderPageStepSub) + buffer_view_->scrollUp(viewport()->height()); + else + buffer_view_->scrollDocView(verticalScrollBar()->sliderPosition()); + + if (lyxrc.cursor_follows_scrollbar) { + buffer_view_->setCursorFromScrollbar(); + lyx_view_->updateLayoutChoice(); + } + // Show the cursor immediately after any operation. + startBlinkingCursor(); QApplication::syncX(); }