From 162ae5c4a7ffa45f63911801a094fe049750cdc3 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Wed, 26 Aug 2015 15:14:23 +0200 Subject: Fix StackView: pushed items still showed up after being popped This is a partial revert of 6ee9612. The idea was to keep items visible until both transitions had finished. StackView { pushExit: null pushEnter: Transition { ... } } When both transitions had finished, all stack elements (except the current one) were hid. The problem was that in pop & replace operations the exiting item was no longer part of the stack (because it had been already popped out) and therefore was never hid. This change restores the original (intended) behavior that a null transition would equal to an immediate operation. This keeps the code simpler, and makes the behavior consistent in a sense that all items are hidden as soon the respective transition finishes. PauseAnimation can be used to wait if desired. Change-Id: Ia9e78506754bdc18949676f061dbfff28a7128b7 Task-number: QTBUG-47317 Reviewed-by: Mitch Curtis --- src/controls/qquickstackview_p.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/controls') diff --git a/src/controls/qquickstackview_p.cpp b/src/controls/qquickstackview_p.cpp index 85c57832..6568d344 100644 --- a/src/controls/qquickstackview_p.cpp +++ b/src/controls/qquickstackview_p.cpp @@ -489,8 +489,8 @@ void QQuickStackViewPrivate::completeTransition(QQuickStackElement *element, QQu QQuickAbstractAnimation *anim = animations.at(&animations, i); anim->complete(); } - viewItemTransitionFinished(element); } + viewItemTransitionFinished(element); } void QQuickStackViewPrivate::viewItemTransitionFinished(QQuickItemViewTransitionableItem *transitionable) @@ -500,17 +500,14 @@ void QQuickStackViewPrivate::viewItemTransitionFinished(QQuickItemViewTransition element->setStatus(QQuickStackView::Active); } else if (element->status == QQuickStackView::Deactivating) { element->setStatus(QQuickStackView::Inactive); + if (element->item) + element->item->setVisible(false); if (element->removal || element->isPendingRemoval()) delete element; } - if (transitioner->runningJobs.isEmpty()) { - int i = elements.count() - 1; - while (--i >= 0) - if (QQuickItem *item = elements[i]->item) - item->setVisible(false); + if (transitioner->runningJobs.isEmpty()) setBusy(false); - } } void QQuickStackViewPrivate::setBusy(bool busy) -- cgit v1.2.3