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 /src/quicktemplates2 | |
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 'src/quicktemplates2')
-rw-r--r-- | src/quicktemplates2/qquickswipedelegate.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickswipedelegate.cpp b/src/quicktemplates2/qquickswipedelegate.cpp index dbf4fc95..356054fb 100644 --- a/src/quicktemplates2/qquickswipedelegate.cpp +++ b/src/quicktemplates2/qquickswipedelegate.cpp @@ -708,13 +708,17 @@ bool QQuickSwipeDelegatePrivate::handleMouseReleaseEvent(QQuickItem *, QMouseEve void QQuickSwipeDelegatePrivate::resizeContent() { - // If the background and contentItem are outside the visible bounds - // of the control (we clip anything outside the bounds), we don't want - // to call QQuickControlPrivate's implementation of this function, + // If the background and contentItem are repositioned due to a swipe, + // we don't want to call QQuickControlPrivate's implementation of this function, // as it repositions the contentItem to be visible. + // However, we still want to resize the control vertically. QQuickSwipePrivate *swipePrivate = QQuickSwipePrivate::get(&swipe); if (!swipePrivate->complete) { - QQuickAbstractButtonPrivate::resizeContent(); + QQuickItemDelegatePrivate::resizeContent(); + } else if (contentItem) { + Q_Q(QQuickSwipeDelegate); + contentItem->setY(q->topPadding()); + contentItem->setHeight(q->availableHeight()); } } |