diff options
author | Mitch Curtis <mitch.curtis@qt.io> | 2016-07-15 10:20:22 +0200 |
---|---|---|
committer | Mitch Curtis <mitch.curtis@qt.io> | 2016-07-15 08:47:28 +0000 |
commit | e9becf6931e9ff12b8912ddb79e4b2cbdd2d530a (patch) | |
tree | 5202327ccf2cebd65568dfabdf80b8b90424af00 /tests/auto/controls/data/tst_swipedelegate.qml | |
parent | 264e67734359726a75ab2ca9853c1cfd606cb1d8 (diff) |
SwipeDelegate: vertically resize contentItem when swipe is complete
Otherwise the delegate's text doesn't change with height animations.
Task-number: QTBUG-54780
Change-Id: I4e253b807e4765732a80100fca102b6650527948
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
Diffstat (limited to 'tests/auto/controls/data/tst_swipedelegate.qml')
-rw-r--r-- | tests/auto/controls/data/tst_swipedelegate.qml | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/auto/controls/data/tst_swipedelegate.qml b/tests/auto/controls/data/tst_swipedelegate.qml index 42ea3542..c6afd89e 100644 --- a/tests/auto/controls/data/tst_swipedelegate.qml +++ b/tests/auto/controls/data/tst_swipedelegate.qml @@ -928,4 +928,28 @@ TestCase { control.destroy(); } + + function test_contentItemHeightOnHeightChanged() { + var control = swipeDelegateComponent.createObject(testCase); + verify(control); + + // Try when swipe.complete is false. + var originalHeight = control.height; + var originalContentItemHeight = control.contentItem.height; + verify(control.height !== 10); + control.height = 10; + compare(control.contentItem.height, control.availableHeight); + verify(control.contentItem.height < originalContentItemHeight); + compare(control.contentItem.y, control.topPadding); + + // Try when swipe.complete is true. + control.height = originalHeight; + swipe(control, 0.0, 1.0); + control.height = 10; + compare(control.contentItem.height, control.availableHeight); + verify(control.contentItem.height < originalContentItemHeight); + compare(control.contentItem.y, control.topPadding); + + control.destroy(); + } } |