Add a StackView around Marketplace to allow extra pages on top

This allows a sort of full-screen pop-up to replace the entire Marketplace window contents, on top of the normal contents. The normal contents are kept as they are, but out of view.

Contributes to issue CURA-8565.
This commit is contained in:
Ghostkeeper 2021-11-26 16:04:23 +01:00 committed by Jelle Spijker
parent 34911380d2
commit 26a39f0240
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A
3 changed files with 149 additions and 118 deletions

View file

@ -42,8 +42,17 @@ Window
anchors.fill: parent
color: UM.Theme.getColor("main_background")
//The Marketplace can have a page in front of everything with package details. The stack view controls its visibility.
StackView
{
id: contextStack
anchors.fill: parent
initialItem: packageBrowse
ColumnLayout
{
id: packageBrowse
anchors.fill: parent
spacing: UM.Theme.getSize("default_margin").height
@ -185,4 +194,5 @@ Window
}
}
}
}
}

View file

@ -0,0 +1,10 @@
// Copyright (c) 2021 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.15
import QtQuick.Controls 2.15
Label
{
text: "Test!"
}

View file

@ -62,10 +62,21 @@ ListView
}
}
delegate: PackageCard
delegate: MouseArea
{
width: parent.width
height: childrenRect.height
onClicked:
{
contextStack.push(Qt.resolvedUrl("PackageDetails.qml"))
}
PackageCard
{
packageData: model.package
}
}
//Wrapper item to add spacing between content and footer.
footer: Item