Skip to content

Commit 4c1a5b8

Browse files
committed
qml: demo StorageOptions component
To achieve a proper demo, the component is added to our StackLayout. Now that there are several components, introduce a toolbar with a textButton "< Back" that allows for rewinding the stack.
1 parent ce8d130 commit 4c1a5b8

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

src/qml/pages/stub.qml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,25 @@ ApplicationWindow {
1818

1919
Component.onCompleted: nodeModel.startNodeInitializionThread();
2020

21+
header: ToolBar {
22+
height: 50
23+
background: null
24+
RowLayout {
25+
anchors.fill: parent
26+
anchors.leftMargin: 10
27+
Loader {
28+
visible: stack.currentIndex > 0 ? true : false
29+
sourceComponent: TextButton {
30+
Layout.alignment: Qt.AlignCenter
31+
Layout.topMargin: 30
32+
text: "‹ Back"
33+
textSize: 18
34+
textColor: "white"
35+
onClicked: stack.currentIndex -= 1
36+
}
37+
}
38+
}
39+
}
2140
ColumnLayout {
2241
id: content
2342
anchors.centerIn: parent
@@ -58,11 +77,12 @@ ApplicationWindow {
5877
Layout.fillWidth: true
5978
ConnectionOptions {}
6079
ConnectionSettings {}
80+
StorageOptions {}
6181
}
6282
ContinueButton {
6383
Layout.alignment: Qt.AlignCenter
64-
text: stack.currentIndex < 1 ? qsTr("Continue") : qsTr("Back")
65-
onClicked: stack.currentIndex < 1 ? stack.currentIndex = 1 : stack.currentIndex = 0
84+
text: stack.currentIndex > 0 ? qsTr("Next") : qsTr("Start")
85+
onClicked: stack.currentIndex < 2 ? stack.currentIndex += 1 : null
6686
}
6787
PageIndicator {
6888
Layout.alignment: Qt.AlignCenter

0 commit comments

Comments
 (0)