mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10:46:35 +01:00
WebScrollBar: Don't update value while slider is down
Makes the scrolling smoother
This commit is contained in:
parent
0ca133bfaf
commit
08af25f4f7
@ -43,23 +43,27 @@ void WebScrollBar::updateValues(const QSize &viewport)
|
||||
setMinimum(0);
|
||||
setParent(m_view->overlayWidget());
|
||||
|
||||
m_blockScrolling = true;
|
||||
int newValue;
|
||||
|
||||
if (orientation() == Qt::Vertical) {
|
||||
setFixedHeight(viewport.height());
|
||||
move(m_view->width() - width(), 0);
|
||||
setPageStep(viewport.height());
|
||||
setMaximum(std::max(0, m_view->page()->contentsSize().toSize().height() - viewport.height()));
|
||||
setValue(m_view->page()->scrollPosition().toPoint().y());
|
||||
newValue = m_view->page()->scrollPosition().toPoint().y();
|
||||
} else {
|
||||
setFixedWidth(viewport.width());
|
||||
move(0, m_view->height() - height());
|
||||
setPageStep(viewport.width());
|
||||
setMaximum(std::max(0, m_view->page()->contentsSize().toSize().width() - viewport.width()));
|
||||
setValue(m_view->page()->scrollPosition().toPoint().x());
|
||||
newValue = m_view->page()->scrollPosition().toPoint().x();
|
||||
}
|
||||
|
||||
m_blockScrolling = false;
|
||||
if (!isSliderDown()) {
|
||||
m_blockScrolling = true;
|
||||
setValue(newValue);
|
||||
m_blockScrolling = false;
|
||||
}
|
||||
|
||||
setVisible(maximum() > minimum());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user