Skip to content

Commit a830232

Browse files
Johnny Carlsonhebasto
authored andcommitted
qml: remove extra ColumnLayouts
Github-Pull: #210 Rebased-From: 4dc32c4
1 parent 3625f4b commit a830232

File tree

9 files changed

+72
-104
lines changed

9 files changed

+72
-104
lines changed

src/qml/BitcoinApp/Controls/InformationPage.qml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Page {
3030
property string subtext: ""
3131
property int subtextMargin: 30
3232
property int subtextSize: 15
33+
property real maximumWidth: 600
34+
property real detailMaximumWidth: 450
3335

3436
background: null
3537
clip: true
@@ -40,7 +42,7 @@ Page {
4042

4143
ColumnLayout {
4244
id: information
43-
width: Math.min(parent.width, 600)
45+
width: Math.min(parent.width, maximumWidth)
4446
anchors.horizontalCenter: parent.horizontalCenter
4547
spacing: 0
4648
Loader {
@@ -71,10 +73,12 @@ Page {
7173
id: detail_loader
7274
active: root.detailActive
7375
visible: active
74-
Layout.fillWidth: true
76+
Layout.alignment: Qt.AlignCenter
7577
Layout.topMargin: 30
7678
Layout.leftMargin: 20
7779
Layout.rightMargin: 20
80+
Layout.fillWidth: true
81+
Layout.maximumWidth: detailMaximumWidth
7882
sourceComponent: root.detailItem
7983
}
8084
}

src/qml/BitcoinApp/NodeRunner.qml

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -16,28 +16,24 @@ Page {
1616
id: navbar
1717
}
1818
ColumnLayout {
19+
width: 600
1920
spacing: 0
20-
anchors.fill: parent
21-
ColumnLayout {
22-
width: 600
23-
spacing: 0
24-
anchors.centerIn: parent
25-
Component.onCompleted: nodeModel.startNodeInitializionThread();
26-
Image {
27-
Layout.alignment: Qt.AlignCenter
28-
source: "image://images/app"
29-
sourceSize.width: 64
30-
sourceSize.height: 64
31-
}
32-
BlockCounter {
33-
Layout.alignment: Qt.AlignCenter
34-
blockHeight: nodeModel.blockTipHeight
35-
}
36-
ProgressIndicator {
37-
width: 200
38-
Layout.alignment: Qt.AlignCenter
39-
progress: nodeModel.verificationProgress
40-
}
21+
anchors.centerIn: parent
22+
Component.onCompleted: nodeModel.startNodeInitializionThread();
23+
Image {
24+
Layout.alignment: Qt.AlignCenter
25+
source: "image://images/app"
26+
sourceSize.width: 64
27+
sourceSize.height: 64
28+
}
29+
BlockCounter {
30+
Layout.alignment: Qt.AlignCenter
31+
blockHeight: nodeModel.blockTipHeight
32+
}
33+
ProgressIndicator {
34+
width: 200
35+
Layout.alignment: Qt.AlignCenter
36+
progress: nodeModel.verificationProgress
4137
}
4238
}
4339
}

src/qml/BitcoinApp/NodeSettings.qml

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -12,73 +12,73 @@ Item {
1212
id: nodeSettings
1313
property alias navMiddleDetail: nodeSettingsView.navMiddleDetail
1414
property alias navRightDetail: nodeSettingsView.navRightDetail
15+
1516
StackView {
1617
id: nodeSettingsView
1718
property alias navMiddleDetail: node_settings.navMiddleDetail
1819
property alias navRightDetail: node_settings.navRightDetail
20+
anchors.fill: parent
21+
1922
initialItem: Page {
2023
id: node_settings
2124
property alias navMiddleDetail: navbar.middleDetail
2225
property alias navRightDetail: navbar.rightDetail
2326
background: null
27+
implicitWidth: 450
28+
leftPadding: 20
29+
rightPadding: 20
30+
topPadding: 30
31+
2432
header: NavigationBar {
2533
id: navbar
2634
}
2735
ColumnLayout {
28-
spacing: 0
29-
width: parent.width
30-
ColumnLayout {
31-
spacing: 20
32-
Layout.maximumWidth: 450
33-
Layout.topMargin: 30
34-
Layout.leftMargin: 20
35-
Layout.rightMargin: 20
36-
Layout.alignment: Qt.AlignCenter
37-
Setting {
38-
Layout.fillWidth: true
39-
header: qsTr("Dark Mode")
40-
actionItem: OptionSwitch {
41-
checked: Theme.dark
42-
onToggled: Theme.toggleDark()
43-
}
36+
spacing: 20
37+
width: Math.min(parent.width, 450)
38+
anchors.horizontalCenter: parent.horizontalCenter
39+
Setting {
40+
Layout.fillWidth: true
41+
header: qsTr("Dark Mode")
42+
actionItem: OptionSwitch {
43+
checked: Theme.dark
44+
onToggled: Theme.toggleDark()
4445
}
45-
Setting {
46-
Layout.fillWidth: true
47-
header: qsTr("About")
48-
actionItem: NavButton {
49-
iconSource: "image://images/caret-right"
50-
background: null
51-
onClicked: {
52-
nodeSettingsView.push(about_page)
53-
}
46+
}
47+
Setting {
48+
Layout.fillWidth: true
49+
header: qsTr("About")
50+
actionItem: NavButton {
51+
iconSource: "image://images/caret-right"
52+
background: null
53+
onClicked: {
54+
nodeSettingsView.push(about_page)
5455
}
5556
}
56-
Setting {
57-
Layout.fillWidth: true
58-
header: qsTr("Storage")
59-
actionItem: NavButton {
60-
iconSource: "image://images/caret-right"
61-
background: null
62-
onClicked: {
63-
nodeSettingsView.push(storage_page)
64-
}
57+
}
58+
Setting {
59+
Layout.fillWidth: true
60+
header: qsTr("Storage")
61+
actionItem: NavButton {
62+
iconSource: "image://images/caret-right"
63+
background: null
64+
onClicked: {
65+
nodeSettingsView.push(storage_page)
6566
}
6667
}
67-
Setting {
68-
Layout.fillWidth: true
69-
header: qsTr("Connection")
70-
actionItem: NavButton {
71-
iconSource: "image://images/caret-right"
72-
background: null
73-
onClicked: {
74-
nodeSettingsView.push(connection_page)
75-
}
68+
}
69+
Setting {
70+
Layout.fillWidth: true
71+
header: qsTr("Connection")
72+
actionItem: NavButton {
73+
iconSource: "image://images/caret-right"
74+
background: null
75+
onClicked: {
76+
nodeSettingsView.push(connection_page)
7677
}
7778
}
7879
}
7980
}
8081
}
81-
anchors.fill: parent
8282
}
8383
Component {
8484
id: about_page

src/qml/BitcoinApp/OnboardingStorageLocation.qml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,6 @@ InformationPage {
2222
description: qsTr("Where do you want to store the downloaded block data?")
2323
descriptionMargin: 20
2424
detailActive: true
25-
detailItem: ColumnLayout {
26-
spacing: 0
27-
StorageLocations {
28-
Layout.maximumWidth: 450
29-
Layout.alignment: Qt.AlignCenter
30-
}
31-
}
25+
detailItem: StorageLocations {}
3226
buttonText: qsTr("Next")
3327
}

src/qml/BitcoinApp/SettingsAbout.qml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,7 @@ Item {
2626
description: qsTr("Bitcoin Core is an open source project.\nIf you find it useful, please contribute.\n\n This is experimental software.")
2727
descriptionMargin: 20
2828
detailActive: true
29-
detailItem: ColumnLayout {
30-
spacing: 0
31-
AboutOptions {
32-
Layout.maximumWidth: 450
33-
Layout.alignment: Qt.AlignCenter
34-
}
35-
}
29+
detailItem: AboutOptions {}
3630
}
3731
SettingsDeveloper {
3832
navLeftDetail: NavButton {

src/qml/BitcoinApp/SettingsConnection.qml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,5 @@ InformationPage {
1616
headerText: qsTr("Connection settings")
1717
headerMargin: 0
1818
detailActive: true
19-
detailItem: ColumnLayout {
20-
spacing: 0
21-
ConnectionSettings {
22-
Layout.maximumWidth: 450
23-
Layout.alignment: Qt.AlignCenter
24-
}
25-
}
19+
detailItem: ConnectionSettings {}
2620
}

src/qml/BitcoinApp/SettingsDeveloper.qml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,5 @@ InformationPage {
1414
headerText: qsTr("Developer options")
1515
headerMargin: 0
1616
detailActive: true
17-
detailItem: ColumnLayout {
18-
spacing: 0
19-
DeveloperOptions {
20-
Layout.maximumWidth: 450
21-
Layout.alignment: Qt.AlignCenter
22-
}
23-
}
17+
detailItem: DeveloperOptions {}
2418
}

src/qml/BitcoinApp/SettingsStorage.qml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,5 @@ InformationPage {
1414
headerText: qsTr("Storage settings")
1515
headerMargin: 0
1616
detailActive: true
17-
detailItem: ColumnLayout {
18-
spacing: 0
19-
StorageSettings {
20-
Layout.maximumWidth: 450
21-
Layout.alignment: Qt.AlignCenter
22-
}
23-
}
17+
detailItem: StorageSettings {}
2418
}

src/qml/BitcoinApp/main.qml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ ApplicationWindow {
2727
SwipeView {
2828
id: swipeView
2929
property bool finished: false
30-
anchors.fill: parent
3130
interactive: false
3231

3332
OnboardingCover {}
@@ -45,7 +44,6 @@ ApplicationWindow {
4544
id: node
4645
SwipeView {
4746
id: node_swipe
48-
anchors.fill: parent
4947
interactive: false
5048
orientation: Qt.Vertical
5149
NodeRunner {

0 commit comments

Comments
 (0)