Skip to content

Commit ddf5585

Browse files
committed
Stackview now more robust.
Push/pop logic was confusing. All we want is a transition. We now use the replace function to get this effect.
1 parent a7069a4 commit ddf5585

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

Import/Esri/ArcGISRuntime/Toolkit/Controls/PopupStackView.qml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
import QtQuick 2.11
1818
import QtQuick.Controls 2.4
19-
import QtQuick.Dialogs 1.2
2019

2120
/*!
2221
\qmltype PopupStackView
@@ -193,10 +192,8 @@ Item {
193192
*/
194193
function show() {
195194
currentIndex = 0;
196-
popupStack.clear();
197195
if (popupManagers !== null && popupManagers.length > 0) {
198196
popup1.popupManagerInternal = popupManagers[currentIndex]
199-
popupStack.push(popup1);
200197
}
201198
visible = true;
202199
}
@@ -296,14 +293,11 @@ Item {
296293

297294
if (popupStack.currentItem === popup1) {
298295
popup2.popupManagerInternal = popupManagers[currentIndex]
299-
popupStack.push(popup2);
300-
}
301-
else
302-
{
296+
popupStack.replace(popup1, popup2);
297+
} else {
303298
popup1.popupManagerInternal = popupManagers[currentIndex]
304-
popupStack.push(popup1);
299+
popupStack.replace(popup2, popup1);
305300
}
306-
307301
}
308302

309303
/*! internal */
@@ -313,12 +307,14 @@ Item {
313307

314308
currentIndex -= 1;
315309

316-
if (popupStack.currentItem === popup2)
310+
if (popupStack.currentItem === popup2) {
317311
popup1.popupManagerInternal = popupManagers[currentIndex];
318-
else
312+
popupStack.replace(popup2, popup1);
313+
}
314+
else {
319315
popup2.popupManagerInternal = popupManagers[currentIndex];
320-
321-
popupStack.pop();
316+
popupStack.replace(popup1, popup2);
317+
}
322318
}
323319

324320
/*! internal */
@@ -477,6 +473,10 @@ Item {
477473
StackView {
478474
id: popupStack
479475
anchors.fill: parent
476+
477+
Component.onCompleted: {
478+
push(popup1)
479+
}
480480
}
481481

482482
Rectangle {

0 commit comments

Comments
 (0)