Skip to content

Commit 25a18f0

Browse files
committed
Merge #463: Fix layouts 1/n
095967e qml: Remove inner stack view from about settings (goqusan) 9644ae9 qml: Remove anchors from node settings (goqusan) 7c8a68c qml: Fix layout in activity view (goqusan) 63e8494 qml: Use content item on desktop wallets (goqusan) Pull request description: - avoid anchors, use layouts - override contentItem - avoid nested stack view ACKs for top commit: johnny9: ACK 095967e Tree-SHA512: 0093bad621dc989fe1825907e20b7e3c45c265cac9245827153e3ab4f4593c6c4dc50993f5c5cf15f7b3a78e0798b4529e0500b9cd881a5bf0fa222ab855d237
2 parents 42f58ad + 095967e commit 25a18f0

File tree

4 files changed

+206
-238
lines changed

4 files changed

+206
-238
lines changed

src/qml/pages/node/NodeSettings.qml

Lines changed: 38 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,41 +9,35 @@ import "../../controls"
99
import "../../components"
1010
import "../settings"
1111

12-
Item {
12+
PageStack {
1313
signal doneClicked
1414

1515
property alias showDoneButton: doneButton.visible
1616

1717
id: root
1818

19-
PageStack {
20-
id: nodeSettingsView
21-
anchors.fill: parent
22-
23-
initialItem: Page {
24-
id: node_settings
25-
background: null
26-
implicitWidth: 450
27-
leftPadding: 20
28-
rightPadding: 20
29-
topPadding: 30
30-
31-
header: NavigationBar2 {
32-
centerItem: Header {
33-
headerBold: true
34-
headerSize: 18
35-
header: "Settings"
36-
}
37-
rightItem: NavButton {
38-
id: doneButton
39-
text: qsTr("Done")
40-
onClicked: root.doneClicked()
41-
}
19+
initialItem: Page {
20+
background: null
21+
header: NavigationBar2 {
22+
centerItem: Header {
23+
headerBold: true
24+
headerSize: 18
25+
header: "Settings"
4226
}
27+
rightItem: NavButton {
28+
id: doneButton
29+
text: qsTr("Done")
30+
onClicked: root.doneClicked()
31+
}
32+
}
33+
contentItem: RowLayout {
4334
ColumnLayout {
35+
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
36+
Layout.fillHeight: false
37+
Layout.fillWidth: true
38+
Layout.margins: 20
39+
Layout.maximumWidth: 450
4440
spacing: 4
45-
width: Math.min(parent.width, 450)
46-
anchors.horizontalCenter: parent.horizontalCenter
4741
Setting {
4842
id: gotoAbout
4943
Layout.fillWidth: true
@@ -52,7 +46,7 @@ Item {
5246
color: gotoAbout.stateColor
5347
}
5448
onClicked: {
55-
nodeSettingsView.push(about_page)
49+
root.push(about_page)
5650
}
5751
}
5852
Separator { Layout.fillWidth: true }
@@ -64,7 +58,7 @@ Item {
6458
color: gotoDisplay.stateColor
6559
}
6660
onClicked: {
67-
nodeSettingsView.push(display_page)
61+
root.push(display_page)
6862
}
6963
}
7064
Separator { Layout.fillWidth: true }
@@ -76,7 +70,7 @@ Item {
7670
color: gotoStorage.stateColor
7771
}
7872
onClicked: {
79-
nodeSettingsView.push(storage_page)
73+
root.push(storage_page)
8074
}
8175
}
8276
Separator { Layout.fillWidth: true }
@@ -88,7 +82,7 @@ Item {
8882
color: gotoConnection.stateColor
8983
}
9084
onClicked: {
91-
nodeSettingsView.push(connection_page)
85+
root.push(connection_page)
9286
}
9387
}
9488
Separator { Layout.fillWidth: true }
@@ -101,7 +95,7 @@ Item {
10195
}
10296
onClicked: {
10397
peerTableModel.startAutoRefresh();
104-
nodeSettingsView.push(peers_page)
98+
root.push(peers_page)
10599
}
106100
}
107101
Separator { Layout.fillWidth: true }
@@ -113,63 +107,67 @@ Item {
113107
color: gotoNetworkTraffic.stateColor
114108
}
115109
onClicked: {
116-
nodeSettingsView.push(networktraffic_page)
110+
root.push(networktraffic_page)
117111
}
118112
}
113+
Item {
114+
Layout.fillHeight: true
115+
}
119116
}
120117
}
121118
}
119+
122120
Component {
123121
id: about_page
124122
SettingsAbout {
125-
onBack: nodeSettingsView.pop()
123+
onBack: root.pop()
126124
}
127125
}
128126
Component {
129127
id: display_page
130128
SettingsDisplay {
131129
onBack: {
132-
nodeSettingsView.pop()
130+
root.pop()
133131
}
134132
}
135133
}
136134
Component {
137135
id: storage_page
138136
SettingsStorage {
139-
onBack: nodeSettingsView.pop()
137+
onBack: root.pop()
140138
}
141139
}
142140
Component {
143141
id: connection_page
144142
SettingsConnection {
145-
onBack: nodeSettingsView.pop()
143+
onBack: root.pop()
146144
}
147145
}
148146
Component {
149147
id: peers_page
150148
Peers {
151149
onBack: {
152-
nodeSettingsView.pop()
150+
root.pop()
153151
peerTableModel.stopAutoRefresh();
154152
}
155153
onPeerSelected: (peerDetails) => {
156-
nodeSettingsView.push(peer_details, {"details": peerDetails})
154+
root.push(peer_details, {"details": peerDetails})
157155
}
158156
}
159157
}
160158
Component {
161159
id: peer_details
162160
PeerDetails {
163161
onBack: {
164-
nodeSettingsView.pop()
162+
root.pop()
165163
}
166164
}
167165
}
168166
Component {
169167
id: networktraffic_page
170168
NetworkTraffic {
171169
showHeader: false
172-
onBack: nodeSettingsView.pop()
170+
onBack: root.pop()
173171
}
174172
}
175173
}

src/qml/pages/settings/SettingsAbout.qml

Lines changed: 53 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -8,77 +8,63 @@ import QtQuick.Layouts 1.15
88
import "../../controls"
99
import "../../components"
1010

11-
Page {
12-
id: root
13-
signal back
11+
InformationPage {
1412
property bool onboarding: false
15-
background: null
16-
PageStack {
17-
id: stack
18-
anchors.fill: parent
19-
initialItem: aboutPage
20-
Component {
21-
id: aboutPage
22-
InformationPage {
23-
id: about_settings
24-
bannerActive: false
25-
bannerMargin: 0
26-
bold: true
27-
showHeader: root.onboarding
28-
headerText: qsTr("About")
29-
headerMargin: 0
30-
description: qsTr("Bitcoin Core is an open source project.\nIf you find it useful, please contribute.\n\n This is experimental software.")
31-
descriptionMargin: 20
32-
detailActive: true
33-
detailItem: AboutOptions {
34-
onNext: stack.push(developerSettings)
35-
}
36-
37-
states: [
38-
State {
39-
when: root.onboarding
40-
PropertyChanges {
41-
target: about_settings
42-
navLeftDetail: backButton
43-
navMiddleDetail: null
44-
}
45-
},
46-
State {
47-
when: !root.onboarding
48-
PropertyChanges {
49-
target: about_settings
50-
navLeftDetail: backButton
51-
navMiddleDetail: header
52-
}
53-
}
54-
]
13+
id: root
14+
bannerActive: false
15+
bannerMargin: 0
16+
bold: true
17+
showHeader: root.onboarding
18+
headerText: qsTr("About")
19+
headerMargin: 0
20+
description: qsTr("Bitcoin Core is an open source project.\nIf you find it useful, please contribute.\n\n This is experimental software.")
21+
descriptionMargin: 20
22+
detailActive: true
23+
detailItem: AboutOptions {
24+
onNext: root.StackView.view.push(developerSettings)
25+
}
5526

56-
Component {
57-
id: backButton
58-
NavButton {
59-
iconSource: "image://images/caret-left"
60-
text: qsTr("Back")
61-
onClicked: root.back()
62-
}
63-
}
64-
Component {
65-
id: header
66-
Header {
67-
headerBold: true
68-
headerSize: 18
69-
header: qsTr("About")
70-
}
71-
}
27+
states: [
28+
State {
29+
when: root.onboarding
30+
PropertyChanges {
31+
target: root
32+
navLeftDetail: backButton
33+
navMiddleDetail: null
7234
}
73-
}
74-
Component {
75-
id: developerSettings
76-
SettingsDeveloper {
77-
onboarding: root.onboarding
78-
onBack: stack.pop()
35+
},
36+
State {
37+
when: !root.onboarding
38+
PropertyChanges {
39+
target: root
40+
navLeftDetail: backButton
41+
navMiddleDetail: header
7942
}
8043
}
81-
}
82-
}
44+
]
8345

46+
Component {
47+
id: backButton
48+
NavButton {
49+
iconSource: "image://images/caret-left"
50+
text: qsTr("Back")
51+
onClicked: root.back()
52+
}
53+
}
54+
Component {
55+
id: header
56+
Header {
57+
headerBold: true
58+
headerSize: 18
59+
header: qsTr("About")
60+
}
61+
}
8462

63+
Component {
64+
id: developerSettings
65+
SettingsDeveloper {
66+
onboarding: root.onboarding
67+
onBack: root.StackView.view.pop()
68+
}
69+
}
70+
}

0 commit comments

Comments
 (0)