Skip to content

Commit beb53e4

Browse files
jarolrodhebasto
authored andcommitted
qml: define the settings pages nav elements at page instantiation
This extracts out the navbar element defintions from the settings page itself, and moves it to where the page is instantiated. This allows the settings views to be reused anywhere else we want to use them, and are now no longer limited to being used within the onboarding wizard. Github-Pull: bitcoin-core#197 Rebased-From: 30db8cc
1 parent 6a5be76 commit beb53e4

File tree

7 files changed

+38
-34
lines changed

7 files changed

+38
-34
lines changed

src/qml/BitcoinApp/SettingsAbout.qml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ import BitcoinApp.Components
1010

1111
InformationPage {
1212
Layout.fillWidth: true
13-
navLeftDetail: NavButton {
14-
iconSource: "image://images/caret-left"
15-
text: qsTr("Back")
16-
onClicked: {
17-
introductions.decrementCurrentIndex()
18-
swipeView.inSubPage = false
19-
}
20-
}
2113
bannerActive: false
2214
bold: true
2315
headerText: qsTr("About")

src/qml/BitcoinApp/SettingsConnection.qml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,6 @@ InformationPage {
1212
background: null
1313
Layout.fillWidth: true
1414
clip: true
15-
navRightDetail: NavButton {
16-
text: qsTr("Done")
17-
onClicked: {
18-
connections.decrementCurrentIndex()
19-
swipeView.inSubPage = false
20-
}
21-
}
2215
bannerActive: false
2316
bold: true
2417
headerText: qsTr("Connection settings")

src/qml/BitcoinApp/SettingsDeveloper.qml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,6 @@ import BitcoinApp.Components
1010

1111
InformationPage {
1212
Layout.fillWidth: true
13-
navLeftDetail: NavButton {
14-
iconSource: "image://images/caret-left"
15-
text: qsTr("Back")
16-
onClicked: {
17-
introductions.decrementCurrentIndex()
18-
swipeView.inSubPage = true
19-
}
20-
}
2113
bannerActive: false
2214
bold: true
2315
headerText: qsTr("Developer options")

src/qml/BitcoinApp/SettingsStorage.qml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,6 @@ import BitcoinApp.Components
1010

1111
InformationPage {
1212
Layout.fillWidth: true
13-
navRightDetail: NavButton {
14-
text: qsTr("Done")
15-
onClicked: {
16-
storages.decrementCurrentIndex()
17-
swipeView.inSubPage = false
18-
}
19-
}
2013
bannerActive: false
2114
bold: true
2215
headerText: qsTr("Storage settings")

src/qml/BitcoinApp/onboarding01.qml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,25 @@ Page {
4545
subtext: qsTr("100% open-source & open-design")
4646
buttonText: qsTr("Start")
4747
}
48-
SettingsAbout {}
49-
SettingsDeveloper {}
48+
SettingsAbout {
49+
navLeftDetail: NavButton {
50+
iconSource: "image://images/caret-left"
51+
text: qsTr("Back")
52+
onClicked: {
53+
introductions.decrementCurrentIndex()
54+
swipeView.inSubPage = false
55+
}
56+
}
57+
}
58+
SettingsDeveloper {
59+
navLeftDetail: NavButton {
60+
iconSource: "image://images/caret-left"
61+
text: qsTr("Back")
62+
onClicked: {
63+
introductions.decrementCurrentIndex()
64+
swipeView.inSubPage = true
65+
}
66+
}
67+
}
5068
}
5169
}

src/qml/BitcoinApp/onboarding05.qml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,14 @@ Page {
5151
}
5252
buttonText: qsTr("Next")
5353
}
54-
SettingsStorage {}
54+
SettingsStorage {
55+
navRightDetail: NavButton {
56+
text: qsTr("Done")
57+
onClicked: {
58+
storages.decrementCurrentIndex()
59+
swipeView.inSubPage = false
60+
}
61+
}
62+
}
5563
}
5664
}

src/qml/BitcoinApp/onboarding06.qml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,14 @@ Page {
4949
lastPage: true
5050
buttonText: qsTr("Next")
5151
}
52-
SettingsConnection {}
52+
SettingsConnection {
53+
navRightDetail: NavButton {
54+
text: qsTr("Done")
55+
onClicked: {
56+
connections.decrementCurrentIndex()
57+
swipeView.inSubPage = false
58+
}
59+
}
60+
}
5361
}
5462
}

0 commit comments

Comments
 (0)