Skip to content

Commit c52566d

Browse files
committed
qml: Swap existing SwipeViews for PageStack
Vertical PageStacks used to replace vertical SwipeViews.
1 parent f0e5951 commit c52566d

File tree

8 files changed

+279
-235
lines changed

8 files changed

+279
-235
lines changed

src/qml/pages/main.qml

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,18 +99,24 @@ ApplicationWindow {
9999

100100
Component {
101101
id: node
102-
SwipeView {
103-
id: node_swipe
104-
interactive: false
105-
orientation: Qt.Vertical
106-
NodeRunner {
107-
onSettingsClicked: {
108-
node_swipe.incrementCurrentIndex()
102+
PageStack {
103+
id: nodeStack
104+
vertical: true
105+
initialItem: node
106+
Component {
107+
id: node
108+
NodeRunner {
109+
onSettingsClicked: {
110+
nodeStack.push(nodeSettings)
111+
}
109112
}
110113
}
111-
NodeSettings {
112-
onDoneClicked: {
113-
node_swipe.decrementCurrentIndex()
114+
Component {
115+
id: nodeSettings
116+
NodeSettings {
117+
onDoneClicked: {
118+
nodeStack.pop()
119+
}
114120
}
115121
}
116122
}

src/qml/pages/onboarding/OnboardingConnection.qml

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -15,46 +15,52 @@ Page {
1515
signal next
1616
background: null
1717
clip: true
18-
SwipeView {
19-
id: connections
18+
PageStack {
19+
id: connectionStack
2020
anchors.fill: parent
21-
interactive: false
22-
orientation: Qt.Vertical
23-
InformationPage {
24-
navLeftDetail: NavButton {
25-
iconSource: "image://images/caret-left"
26-
text: qsTr("Back")
27-
onClicked: root.back()
28-
}
29-
bannerItem: Image {
30-
Layout.topMargin: 20
31-
Layout.alignment: Qt.AlignCenter
32-
source: Theme.image.storage
33-
sourceSize.width: 200
34-
sourceSize.height: 200
35-
}
36-
bold: true
37-
headerText: qsTr("Starting initial download")
38-
headerMargin: 30
39-
description: qsTr("The application will connect to the Bitcoin network and start downloading and verifying transactions.\n\nThis may take several hours, or even days, based on your connection.")
40-
descriptionMargin: 10
41-
detailActive: true
42-
detailTopMargin: 10
43-
detailItem: RowLayout {
44-
TextButton {
21+
vertical: true
22+
initialItem: onboardingConnection
23+
Component {
24+
id: onboardingConnection
25+
InformationPage {
26+
navLeftDetail: NavButton {
27+
iconSource: "image://images/caret-left"
28+
text: qsTr("Back")
29+
onClicked: root.back()
30+
}
31+
bannerItem: Image {
32+
Layout.topMargin: 20
4533
Layout.alignment: Qt.AlignCenter
46-
text: qsTr("Connection settings")
47-
onClicked: connections.incrementCurrentIndex()
34+
source: Theme.image.storage
35+
sourceSize.width: 200
36+
sourceSize.height: 200
4837
}
38+
bold: true
39+
headerText: qsTr("Starting initial download")
40+
headerMargin: 30
41+
description: qsTr("The application will connect to the Bitcoin network and start downloading and verifying transactions.\n\nThis may take several hours, or even days, based on your connection.")
42+
descriptionMargin: 10
43+
detailActive: true
44+
detailTopMargin: 10
45+
detailItem: RowLayout {
46+
TextButton {
47+
Layout.alignment: Qt.AlignCenter
48+
text: qsTr("Connection settings")
49+
onClicked: connectionStack.push(connectionSettings)
50+
}
51+
}
52+
lastPage: true
53+
buttonText: qsTr("Next")
54+
buttonMargin: 20
55+
onNext: root.next()
4956
}
50-
lastPage: true
51-
buttonText: qsTr("Next")
52-
buttonMargin: 20
53-
onNext: root.next()
5457
}
55-
SettingsConnection {
56-
onboarding: true
57-
onBack: connections.decrementCurrentIndex()
58+
Component {
59+
id: connectionSettings
60+
SettingsConnection {
61+
onboarding: true
62+
onBack: connectionStack.pop()
63+
}
5864
}
5965
}
6066
}

src/qml/pages/onboarding/OnboardingCover.qml

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -14,47 +14,50 @@ Page {
1414
signal next
1515
background: null
1616
clip: true
17-
SwipeView {
18-
id: introductions
17+
PageStack {
18+
id: coverStack
1919
anchors.fill: parent
20-
interactive: false
21-
orientation: Qt.Horizontal
22-
InformationPage {
23-
navRightDetail: NavButton {
24-
iconSource: "image://images/info"
25-
iconHeight: 24
26-
iconWidth: 24
27-
iconColor: Theme.color.neutral0
28-
iconBackground: Rectangle {
29-
radius: 12
30-
color: Theme.color.neutral9
20+
initialItem: onboardingCover
21+
Component {
22+
id: onboardingCover
23+
InformationPage {
24+
navRightDetail: NavButton {
25+
iconSource: "image://images/info"
26+
iconHeight: 24
27+
iconWidth: 24
28+
iconColor: Theme.color.neutral0
29+
iconBackground: Rectangle {
30+
radius: 12
31+
color: Theme.color.neutral9
32+
}
33+
onClicked: coverStack.push(coverSettings)
3134
}
32-
onClicked: {
33-
introductions.incrementCurrentIndex()
35+
bannerItem: Image {
36+
Layout.fillWidth: true
37+
Layout.alignment: Qt.AlignCenter
38+
source: "image://images/app"
39+
// Bitcoin icon has ~11% padding
40+
sourceSize.width: 112
41+
sourceSize.height: 112
3442
}
43+
bannerMargin: 0
44+
bold: true
45+
headerText: qsTr("Bitcoin Core App")
46+
headerSize: 36
47+
description: qsTr("Be part of the Bitcoin network.")
48+
descriptionMargin: 10
49+
descriptionSize: 24
50+
subtext: qsTr("100% open-source & open-design")
51+
buttonText: qsTr("Start")
52+
onNext: root.next()
3553
}
36-
bannerItem: Image {
37-
Layout.fillWidth: true
38-
Layout.alignment: Qt.AlignCenter
39-
source: "image://images/app"
40-
// Bitcoin icon has ~11% padding
41-
sourceSize.width: 112
42-
sourceSize.height: 112
43-
}
44-
bannerMargin: 0
45-
bold: true
46-
headerText: qsTr("Bitcoin Core App")
47-
headerSize: 36
48-
description: qsTr("Be part of the Bitcoin network.")
49-
descriptionMargin: 10
50-
descriptionSize: 24
51-
subtext: qsTr("100% open-source & open-design")
52-
buttonText: qsTr("Start")
53-
onNext: root.next()
5454
}
55-
SettingsAbout {
56-
onboarding: true
57-
onBack: introductions.decrementCurrentIndex()
55+
Component {
56+
id: coverSettings
57+
SettingsAbout {
58+
onboarding: true
59+
onBack: coverStack.pop()
60+
}
5861
}
5962
}
6063
}

src/qml/pages/onboarding/OnboardingStorageAmount.qml

Lines changed: 50 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,49 +13,63 @@ Page {
1313
id: root
1414
signal back
1515
signal next
16+
property bool customStorage: false
17+
property int customStorageAmount
1618
background: null
1719
clip: true
18-
SwipeView {
19-
id: storages
20+
PageStack {
21+
id: stack
2022
anchors.fill: parent
21-
interactive: false
22-
orientation: Qt.Vertical
23-
InformationPage {
24-
navLeftDetail: NavButton {
25-
iconSource: "image://images/caret-left"
26-
text: qsTr("Back")
27-
onClicked: root.back()
28-
}
29-
bannerActive: false
30-
bold: true
31-
headerText: qsTr("Storage")
32-
headerMargin: 0
33-
description: qsTr("Data retrieved from the Bitcoin network is stored on your device.\nYou have 500GB of storage available.")
34-
descriptionMargin: 10
35-
detailActive: true
36-
detailItem: ColumnLayout {
37-
spacing: 0
38-
StorageOptions {
39-
customStorage: advancedStorage.loadedDetailItem.customStorage
40-
customStorageAmount: advancedStorage.loadedDetailItem.customStorageAmount
41-
Layout.maximumWidth: 450
42-
Layout.alignment: Qt.AlignCenter
23+
vertical: true
24+
initialItem: onboardingStorageAmount
25+
Component {
26+
id: onboardingStorageAmount
27+
InformationPage {
28+
navLeftDetail: NavButton {
29+
iconSource: "image://images/caret-left"
30+
text: qsTr("Back")
31+
onClicked: root.back()
4332
}
44-
TextButton {
45-
Layout.topMargin: 10
46-
Layout.alignment: Qt.AlignCenter
47-
text: qsTr("Detailed settings")
48-
onClicked: storages.incrementCurrentIndex()
33+
bannerActive: false
34+
bold: true
35+
headerText: qsTr("Storage")
36+
headerMargin: 0
37+
description: qsTr("Data retrieved from the Bitcoin network is stored on your device.\nYou have 500GB of storage available.")
38+
descriptionMargin: 10
39+
detailActive: true
40+
detailItem: ColumnLayout {
41+
spacing: 0
42+
StorageOptions {
43+
customStorage: advancedStorage.loadedDetailItem.customStorage
44+
customStorageAmount: advancedStorage.loadedDetailItem.customStorageAmount
45+
Layout.maximumWidth: 450
46+
Layout.alignment: Qt.AlignCenter
47+
}
48+
TextButton {
49+
Layout.topMargin: 10
50+
Layout.alignment: Qt.AlignCenter
51+
text: qsTr("Detailed settings")
52+
onClicked: stack.push(storageAmountSettings)
53+
}
4954
}
55+
buttonText: qsTr("Next")
56+
buttonMargin: 20
57+
onNext: root.next()
5058
}
51-
buttonText: qsTr("Next")
52-
buttonMargin: 20
53-
onNext: root.next()
5459
}
55-
SettingsStorage {
56-
id: advancedStorage
57-
onboarding: true
58-
onBack: storages.decrementCurrentIndex()
60+
Component {
61+
id: storageAmountSettings
62+
SettingsStorage {
63+
id: advancedStorage
64+
onboarding: true
65+
onBack: stack.pop()
66+
onCustomStorageChanged: {
67+
root.customStorage = advancedStorage.customStorage
68+
}
69+
onCustomStorageAmountChanged: {
70+
root.customStorageAmount = advancedStorage.customStorageAmount
71+
}
72+
}
5973
}
6074
}
6175
}

0 commit comments

Comments
 (0)