diff options
author | J-P Nurmi <jpnurmi@qt.io> | 2016-10-16 22:39:43 +0200 |
---|---|---|
committer | J-P Nurmi <jpnurmi@qt.io> | 2016-10-17 09:53:30 +0000 |
commit | c95350a57c5246e869ec7cc3392dec7f3619f9bd (patch) | |
tree | 5e182d7ee35b01865d62852e9f41493a16f1b65b /tests | |
parent | ed7521d27cbba69196870005c9d97129a6d7b781 (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 'tests')
-rw-r--r-- | tests/auto/controls/data/tst_scrollbar.qml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_scrollbar.qml b/tests/auto/controls/data/tst_scrollbar.qml index f8ac936e..1684ba51 100644 --- a/tests/auto/controls/data/tst_scrollbar.qml +++ b/tests/auto/controls/data/tst_scrollbar.qml @@ -201,6 +201,31 @@ TestCase { control.destroy() } + function test_increase_decrease_data() { + return [ + { tag: "increase:active", increase: true, active: true }, + { tag: "decrease:active", increase: false, active: true }, + { tag: "increase:inactive", increase: true, active: false }, + { tag: "decrease:inactive", increase: false, active: false } + ] + } + + function test_increase_decrease(data) { + var control = scrollBar.createObject(testCase, {position: 0.5, active: data.active}) + verify(control) + + if (data.increase) { + control.increase() + compare(control.position, 0.6) + } else { + control.decrease() + compare(control.position, 0.4) + } + compare(control.active, data.active) + + control.destroy() + } + function test_stepSize_data() { return [ { tag: "0.0", stepSize: 0.0 }, |