diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2017-06-08 23:04:06 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2017-06-16 08:45:42 +0000 |
commit | e96fd5f39158f775d45ae9a60564f00454b789ed (patch) | |
tree | 8de27d350b79b9190a3e3eacdc5935246ce8871a /src | |
parent | 513363e940e0978931083544374bfe092107b9fb (diff) |
ScrollBar: fix flashing in Material & Universal styles
Ensure a suitable starting opacity for the inactive state transition.
When calling increase() and decrease() from key-handlers, as the docs
suggest, we flash the scrollbar by turning the active state on, and
then back off immediately. If there is an opacity animation when the
scrollbar becomes active (Material & Universal), the opacity animation
is stopped right away, because the state changes back to inactive. This
state changing trick worked only with the Default style, because it
changes the opacity without animating when it becomes active.
Change-Id: I4117de79c7145a710c0b6c43873ca2336b64e21e
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/imports/controls/material/ScrollBar.qml | 1 | ||||
-rw-r--r-- | src/imports/controls/universal/ScrollBar.qml | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/imports/controls/material/ScrollBar.qml b/src/imports/controls/material/ScrollBar.qml index 156c5781..8374c0f9 100644 --- a/src/imports/controls/material/ScrollBar.qml +++ b/src/imports/controls/material/ScrollBar.qml @@ -81,6 +81,7 @@ T.ScrollBar { Transition { from: "active" SequentialAnimation { + PropertyAction{ targets: [contentItem, background]; property: "opacity"; value: 1.0 } PauseAnimation { duration: 2450 } NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 0.0 } } diff --git a/src/imports/controls/universal/ScrollBar.qml b/src/imports/controls/universal/ScrollBar.qml index 981e382a..cbb81f1b 100644 --- a/src/imports/controls/universal/ScrollBar.qml +++ b/src/imports/controls/universal/ScrollBar.qml @@ -83,6 +83,7 @@ T.ScrollBar { Transition { from: "active" SequentialAnimation { + PropertyAction{ targets: [contentItem, background]; property: "opacity"; value: 1.0 } PauseAnimation { duration: 3000 } NumberAnimation { targets: [contentItem, background]; property: "opacity"; to: 0.0 } } |