From c95350a57c5246e869ec7cc3392dec7f3619f9bd Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Sun, 16 Oct 2016 22:39:43 +0200 Subject: ScrollBar::increase/decrease(): remember the previous active status These methods toggle the active status to flash the scrollbar. The active status must not be inactivated if the scrollbar was already active while increasing or decreasing eg. via buttons. Change-Id: I2902f58a26ab5e56ff89aa921cae7a7ae8404ee3 Reviewed-by: Mitch Curtis --- src/quicktemplates2/qquickscrollbar.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/quicktemplates2/qquickscrollbar.cpp') diff --git a/src/quicktemplates2/qquickscrollbar.cpp b/src/quicktemplates2/qquickscrollbar.cpp index 19f7aea4..69cac6ee 100644 --- a/src/quicktemplates2/qquickscrollbar.cpp +++ b/src/quicktemplates2/qquickscrollbar.cpp @@ -328,9 +328,10 @@ void QQuickScrollBar::increase() { Q_D(QQuickScrollBar); qreal step = qFuzzyIsNull(d->stepSize) ? 0.1 : d->stepSize; + bool wasActive = d->active; setActive(true); setPosition(d->position + step); - setActive(false); + setActive(wasActive); } /*! @@ -344,9 +345,10 @@ void QQuickScrollBar::decrease() { Q_D(QQuickScrollBar); qreal step = qFuzzyIsNull(d->stepSize) ? 0.1 : d->stepSize; + bool wasActive = d->active; setActive(true); setPosition(d->position - step); - setActive(false); + setActive(wasActive); } void QQuickScrollBar::mousePressEvent(QMouseEvent *event) -- cgit v1.2.3