Skip to content

Commit 0012219

Browse files
committed
qml: Move CoinSelection list header outside of ListView
1 parent 875b583 commit 0012219

File tree

1 file changed

+55
-51
lines changed

1 file changed

+55
-51
lines changed

src/qml/pages/wallet/CoinSelection.qml

Lines changed: 55 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -34,63 +34,67 @@ Page {
3434
color: Theme.color.neutral0
3535
}
3636

37-
ListView {
38-
id: listView
39-
clip: true
37+
ColumnLayout {
38+
id: header
4039
width: Math.min(parent.width - 40, 450)
41-
height: parent.height
4240
anchors.horizontalCenter: parent.horizontalCenter
43-
model: root.wallet.coinsListModel
44-
spacing: 15
4541

46-
header: ColumnLayout {
47-
width: listView.width
48-
RowLayout {
42+
RowLayout {
43+
Layout.fillWidth: true
44+
spacing: 15
45+
CoreText {
46+
Layout.alignment: Qt.AlignLeft
4947
Layout.fillWidth: true
50-
spacing: 15
51-
CoreText {
52-
Layout.alignment: Qt.AlignLeft
53-
Layout.fillWidth: true
54-
Layout.preferredWidth: 0
55-
font.pixelSize: 18
56-
color: Theme.color.neutral9
57-
elide: Text.ElideMiddle
58-
wrapMode: Text.NoWrap
59-
horizontalAlignment: Text.AlignLeft
60-
text: qsTr("Total selected")
61-
}
62-
CoreText {
63-
Layout.alignment: Qt.AlignRight
64-
color: Theme.color.neutral9
65-
font.pixelSize: 18
66-
text: root.wallet.coinsListModel.totalSelected
67-
}
48+
Layout.preferredWidth: 0
49+
font.pixelSize: 18
50+
color: Theme.color.neutral9
51+
elide: Text.ElideMiddle
52+
wrapMode: Text.NoWrap
53+
horizontalAlignment: Text.AlignLeft
54+
text: qsTr("Total selected")
6855
}
69-
RowLayout {
70-
Layout.bottomMargin: 30
71-
CoreText {
72-
Layout.alignment: Qt.AlignLeft
73-
Layout.fillWidth: true
74-
Layout.preferredWidth: 0
75-
font.pixelSize: 15
76-
color: Theme.color.neutral7
77-
elide: Text.ElideMiddle
78-
wrapMode: Text.NoWrap
79-
horizontalAlignment: Text.AlignLeft
80-
text: if (root.wallet.coinsListModel.overRequiredAmount) {
81-
qsTr("Over required amount")
82-
} else {
83-
qsTr("Remaining to select")
84-
}
85-
}
86-
CoreText {
87-
Layout.alignment: Qt.AlignRight
88-
font.pixelSize: 15
89-
color: Theme.color.neutral7
90-
text: root.wallet.coinsListModel.changeAmount
56+
CoreText {
57+
Layout.alignment: Qt.AlignRight
58+
color: Theme.color.neutral9
59+
font.pixelSize: 18
60+
text: root.wallet.coinsListModel.totalSelected
61+
}
62+
}
63+
RowLayout {
64+
Layout.bottomMargin: 30
65+
CoreText {
66+
Layout.alignment: Qt.AlignLeft
67+
Layout.fillWidth: true
68+
Layout.preferredWidth: 0
69+
font.pixelSize: 15
70+
color: Theme.color.neutral7
71+
elide: Text.ElideMiddle
72+
wrapMode: Text.NoWrap
73+
horizontalAlignment: Text.AlignLeft
74+
text: if (root.wallet.coinsListModel.overRequiredAmount) {
75+
qsTr("Over required amount")
76+
} else {
77+
qsTr("Remaining to select")
9178
}
9279
}
80+
CoreText {
81+
Layout.alignment: Qt.AlignRight
82+
font.pixelSize: 15
83+
color: Theme.color.neutral7
84+
text: root.wallet.coinsListModel.changeAmount
85+
}
9386
}
87+
}
88+
89+
ListView {
90+
id: listView
91+
clip: true
92+
width: Math.min(parent.width - 40, 450)
93+
height: parent.height - header.height - 20
94+
anchors.top: header.bottom
95+
anchors.horizontalCenter: parent.horizontalCenter
96+
model: root.wallet.coinsListModel
97+
spacing: 15
9498

9599
delegate: ItemDelegate {
96100
id: delegate
@@ -113,13 +117,13 @@ Page {
113117

114118
leftPadding: 0
115119
rightPadding: 0
116-
topPadding: 14
120+
topPadding: 0
117121
bottomPadding: 14
118122
width: listView.width
119123

120124
background: Item {
121125
Separator {
122-
anchors.top: parent.top
126+
anchors.bottom: parent.bottom
123127
width: parent.width
124128
}
125129
}

0 commit comments

Comments
 (0)