mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Give a sane behaviour to page up/down scrolling when clicking in the page scroll area of the scrollbar.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20287 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
e99d97c127
commit
78b78ec6e1
@ -339,6 +339,7 @@ void BufferView::scrollDocView(int value)
|
|||||||
int const h = tm.parMetrics(anchor_ref_).height();
|
int const h = tm.parMetrics(anchor_ref_).height();
|
||||||
offset_ref_ = int((bar * t.paragraphs().size() - anchor_ref_) * h);
|
offset_ref_ = int((bar * t.paragraphs().size() - anchor_ref_) * h);
|
||||||
updateMetrics(false);
|
updateMetrics(false);
|
||||||
|
buffer_.changed();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -255,20 +255,6 @@ void WorkArea::updateScrollbar()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void WorkArea::scrollBufferView(int position)
|
|
||||||
{
|
|
||||||
stopBlinkingCursor();
|
|
||||||
buffer_view_->scrollDocView(position);
|
|
||||||
redraw();
|
|
||||||
if (lyxrc.cursor_follows_scrollbar) {
|
|
||||||
buffer_view_->setCursorFromScrollbar();
|
|
||||||
lyx_view_->updateLayoutChoice();
|
|
||||||
}
|
|
||||||
// Show the cursor immediately after any operation.
|
|
||||||
startBlinkingCursor();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void WorkArea::showCursor()
|
void WorkArea::showCursor()
|
||||||
{
|
{
|
||||||
if (cursor_visible_)
|
if (cursor_visible_)
|
||||||
|
@ -111,8 +111,6 @@ protected:
|
|||||||
void close();
|
void close();
|
||||||
///
|
///
|
||||||
void resizeBufferView();
|
void resizeBufferView();
|
||||||
///
|
|
||||||
void scrollBufferView(int position);
|
|
||||||
/// hide the visible cursor, if it is visible
|
/// hide the visible cursor, if it is visible
|
||||||
void hideCursor();
|
void hideCursor();
|
||||||
/// show the cursor if it is not visible
|
/// show the cursor if it is not visible
|
||||||
|
@ -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();
|
QApplication::syncX();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user