Skip to content

Commit 02a3b25

Browse files
committed
qml: use signal based navigation in settings with subpages
Here, pages are clearly contained, but the logic of moving to SettingsDeveloper from within SettingsAbout and SettingsProxy from within SettingsConnection is still contained here within the definitions of SettingsAbout and SettingsConnection. While all pages are independently still usable, we do want to iron out this one kink in a follow-up.
1 parent fad9bd7 commit 02a3b25

File tree

4 files changed

+12
-4
lines changed

4 files changed

+12
-4
lines changed

src/qml/components/AboutOptions.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import QtQuick.Layouts 1.15
88
import "../controls"
99

1010
ColumnLayout {
11+
id: root
12+
signal next
1113
spacing: 4
1214
Setting {
1315
id: websiteLink
@@ -69,7 +71,7 @@ ColumnLayout {
6971
color: gotoDeveloper.stateColor
7072
}
7173
onClicked: {
72-
aboutSwipe.incrementCurrentIndex()
74+
root.next()
7375
}
7476
}
7577
ExternalPopup {

src/qml/components/ConnectionSettings.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ import QtQuick.Layouts 1.15
88
import "../controls"
99

1010
ColumnLayout {
11+
id: root
12+
signal next
1113
spacing: 4
1214
Setting {
1315
Layout.fillWidth: true
@@ -69,6 +71,6 @@ ColumnLayout {
6971
actionItem: CaretRightIcon {
7072
color: gotoProxy.stateColor
7173
}
72-
onClicked: connectionSwipe.incrementCurrentIndex()
74+
onClicked: root.next()
7375
}
7476
}

src/qml/pages/settings/SettingsAbout.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ Item {
3232
description: qsTr("Bitcoin Core is an open source project.\nIf you find it useful, please contribute.\n\n This is experimental software.")
3333
descriptionMargin: 20
3434
detailActive: true
35-
detailItem: AboutOptions {}
35+
detailItem: AboutOptions {
36+
onNext: aboutSwipe.incrementCurrentIndex()
37+
}
3638
}
3739
SettingsDeveloper {
3840
id: about_developer

src/qml/pages/settings/SettingsConnection.qml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ Item {
3131
headerText: qsTr("Connection settings")
3232
headerMargin: 0
3333
detailActive: true
34-
detailItem: ConnectionSettings {}
34+
detailItem: ConnectionSettings {
35+
onNext: connectionSwipe.incrementCurrentIndex()
36+
}
3537
}
3638
SettingsProxy {
3739
onBackClicked: {

0 commit comments

Comments
 (0)