aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickscrollbar.cpp
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-10-16 22:39:43 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-10-17 09:53:30 +0000
commitc95350a57c5246e869ec7cc3392dec7f3619f9bd (patch)
tree5e182d7ee35b01865d62852e9f41493a16f1b65b /src/quicktemplates2/qquickscrollbar.cpp
parented7521d27cbba69196870005c9d97129a6d7b781 (diff)
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 <mitch.curtis@qt.io>
Diffstat (limited to 'src/quicktemplates2/qquickscrollbar.cpp')
-rw-r--r--src/quicktemplates2/qquickscrollbar.cpp6
1 files changed, 4 insertions, 2 deletions
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)