Skip to content

Commit c767837

Browse files
committed
Merge #466: Visual tweaks to the fee selector in the send form
e06c32a Visual tweaks to the fee selector in the send form (GBKS) Pull request description: These are purely cosmetic adjustments: - Make the font size of the selector copy the same as other send form fields - Lighter color for the option durations - Various spacing tweaks for a more harmonious appearance (for example, tighten up the overall popup padding, make the top and bottom padding of each item in the dropdown the same, visually balance left/right padding of each item...) There are still some very minor details like item height, hover state, etc that we may tweak further to make our design system consistent. But these tweaks here should get us very close. ![image](https://github.com/user-attachments/assets/fea91906-5f9e-42a1-a0c0-9d2bdc16fbed) How does that look? Anything else we should adjust? ACKs for top commit: johnny9: tACK e06c32a Tree-SHA512: 6d29bc0385954b2a26e8e326081240e84ccc92019aead64649968d09ee26506e9ded6e38e4a3b8c9e508569c0fb57ac423a4ccdbe427f297fe7f2d7840eb4c08
2 parents 0233931 + e06c32a commit c767837

File tree

1 file changed

+48
-19
lines changed

1 file changed

+48
-19
lines changed

src/qml/components/FeeSelection.qml

Lines changed: 48 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ RowLayout {
1414

1515
property int selectedIndex: 1
1616
property string selectedLabel: feeModel.get(root.selectedIndex).feeLabel
17+
property string selectedDuration: feeModel.get(root.selectedIndex).feeDuration
1718

1819
signal feeChanged(int target)
1920

@@ -22,30 +23,49 @@ RowLayout {
2223
CoreText {
2324
Layout.fillWidth: true
2425
horizontalAlignment: Text.AlignLeft
25-
font.pixelSize: 15
26+
font.pixelSize: 18
2627
text: qsTr("Fee")
2728
}
2829

2930
Button {
3031
id: dropDownButton
3132
text: root.selectedLabel
32-
font.pixelSize: 15
33+
font.pixelSize: 18
3334

3435
hoverEnabled: true
3536

37+
leftPadding: 10
38+
rightPadding: 4
39+
topPadding: 2
40+
bottomPadding: 2
41+
height: 28
42+
3643
HoverHandler {
3744
cursorShape: Qt.PointingHandCursor
3845
}
3946

4047
onPressed: feePopup.open()
4148

4249
contentItem: RowLayout {
43-
spacing: 5
50+
spacing: 0
4451

4552
CoreText {
4653
id: value
4754
text: root.selectedLabel
48-
font.pixelSize: 15
55+
font.pixelSize: 18
56+
57+
Behavior on color {
58+
ColorAnimation { duration: 150 }
59+
}
60+
}
61+
62+
Item { width: 5 }
63+
64+
CoreText {
65+
id: duration
66+
text: root.selectedDuration
67+
font.pixelSize: 18
68+
color: dropDownButton.enabled ? Theme.color.neutral7 : Theme.color.neutral4
4969

5070
Behavior on color {
5171
ColorAnimation { duration: 150 }
@@ -98,13 +118,14 @@ RowLayout {
98118
background: Rectangle {
99119
color: Theme.color.background
100120
radius: 6
101-
border.color: Theme.color.neutral3
121+
border.color: Theme.color.neutral4
102122
}
103123

104124
width: 260
105-
height: Math.min(feeModel.count * 40 + 20, 300)
125+
height: Math.min(feeModel.count * 36 + 10, 300)
106126
x: feePopup.parent.width - feePopup.width
107-
y: feePopup.parent.height
127+
y: feePopup.parent.height + 2
128+
padding: 5
108129

109130
contentItem: ListView {
110131
id: feeList
@@ -115,35 +136,42 @@ RowLayout {
115136
delegate: ItemDelegate {
116137
id: delegate
117138
required property string feeLabel
139+
required property string feeDuration
118140
required property int index
119141
required property int target
120142

121143
width: ListView.view.width
122-
height: 40
144+
height: 36
145+
146+
leftPadding: 10
147+
rightPadding: 4
148+
topPadding: 2
149+
bottomPadding: 2
123150

124151
background: Item {
125152
Rectangle {
126153
anchors.fill: parent
127154
radius: 6
128-
color: Theme.color.neutral3
129-
visible: delegate.hovered
130-
}
131-
Separator {
132-
width: parent.width
133-
anchors.top: parent.top
134155
color: Theme.color.neutral2
135-
visible: delegate.index > 0
156+
visible: delegate.hovered
136157
}
137158
}
138159

139160
contentItem: RowLayout {
140-
spacing: 10
161+
spacing: 5
141162

142163
CoreText {
143164
text: feeLabel
144165
horizontalAlignment: Text.AlignLeft
166+
font.pixelSize: 15
167+
}
168+
169+
CoreText {
170+
text: feeDuration
171+
horizontalAlignment: Text.AlignLeft
145172
Layout.fillWidth: true
146173
font.pixelSize: 15
174+
color: Theme.color.neutral7
147175
}
148176

149177
Icon {
@@ -161,6 +189,7 @@ RowLayout {
161189
onClicked: {
162190
root.selectedIndex = delegate.index
163191
root.selectedLabel = feeLabel
192+
root.selectedDuration = feeDuration
164193
root.feeChanged(target)
165194
feePopup.close()
166195
}
@@ -170,8 +199,8 @@ RowLayout {
170199

171200
ListModel {
172201
id: feeModel
173-
ListElement { feeLabel: qsTr("High (~10 mins)"); target: 1 }
174-
ListElement { feeLabel: qsTr("Default (~60 mins)"); target: 6 }
175-
ListElement { feeLabel: qsTr("Low (~24 hrs)"); target: 144 }
202+
ListElement { feeLabel: qsTr("High"); feeDuration: qsTr("(~10 mins)"); target: 1 }
203+
ListElement { feeLabel: qsTr("Default"); feeDuration: qsTr("(~60 mins)"); target: 6 }
204+
ListElement { feeLabel: qsTr("Low"); feeDuration: qsTr("(~24 hrs)"); target: 144 }
176205
}
177206
}

0 commit comments

Comments
 (0)