Skip to content

Commit 284a4b5

Browse files
committed
qt: receive page UI refinements
- Show Copy request and QR code side by side as the primary request actions. - Move Edit payment request into the overflow menu. - Keep New Request as a secondary outline action below a separator. - Display em dashes for empty disabled fields
1 parent 696c347 commit 284a4b5

10 files changed

Lines changed: 173 additions & 238 deletions

qml/bitcoin_qml.qrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<qresource prefix="/qml">
33
<file>components/AboutOptions.qml</file>
44
<file>components/AddressDetailRow.qml</file>
5+
<file>components/AddressLabel.qml</file>
56
<file>components/AlertAction.qml</file>
67
<file>components/AlertPopup.qml</file>
78
<file>components/BitcoinAddressDisplayField.qml</file>

qml/components/BitcoinAmountInputField.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ ColumnLayout {
2121
property alias unitLabelObjectName: unitLabel.objectName
2222
property alias errorTextObjectName: errorTextLabel.objectName
2323
property bool enabled: true
24+
property string placeholderText: root.amount ? root.amountInputPlaceholder(root.amount.unit) : "0.00000000"
2425

2526
signal inputTextChanged
2627
signal textEdited
@@ -119,7 +120,7 @@ ColumnLayout {
119120
color: Theme.color.neutral9
120121
placeholderTextColor: enabled ? Theme.color.neutral7 : Theme.color.neutral4
121122
background: Item {}
122-
placeholderText: root.amount ? root.amountInputPlaceholder(root.amount.unit) : "0.00000000"
123+
placeholderText: root.placeholderText
123124
selectByMouse: true
124125

125126
text: ""

qml/components/ReceiveOptionsPopup.qml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ ContextMenu {
1717
property alias showNoteSelf: noteSelfToggle.checked
1818
property alias showAddressType: addressTypeToggle.checked
1919
property bool showRequestActions: false
20+
property bool showEditAction: false
2021

22+
signal editRequest()
2123
signal useAsTemplate()
2224
signal deleteFromHistory()
2325
signal viewAddressHistory()
@@ -54,6 +56,13 @@ ContextMenu {
5456

5557
ContextMenuDivider {}
5658

59+
ContextMenuButton {
60+
objectName: "receiveOptionsEditButton"
61+
visible: root.showEditAction
62+
text: qsTr("Edit payment request")
63+
onTriggered: root.editRequest()
64+
}
65+
5766
ContextMenuButton {
5867
objectName: "receiveOptionsViewAddressHistoryButton"
5968
text: qsTr("View address history")

qml/controls/ContinueButton.qml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Button {
2222
property color borderPressedColor: "transparent"
2323
property bool bold: true
2424
property bool busy: false
25+
property url iconSource: ""
2526
property var textStyle: bold ? Theme.text.buttonStrong : Theme.text.button
2627
property int textFontPixelSize: textStyle.pixelSize
2728
property string textFontStyleName: textStyle.styleName
@@ -32,7 +33,7 @@ Button {
3233
RowLayout {
3334
id: contentRow
3435
anchors.centerIn: parent
35-
spacing: 8
36+
spacing: 4
3637

3738
SpinningIndicator {
3839
Layout.alignment: Qt.AlignVCenter
@@ -41,6 +42,14 @@ Button {
4142
color: root.textColor
4243
}
4344

45+
Icon {
46+
Layout.alignment: Qt.AlignVCenter
47+
visible: !root.busy && root.iconSource.toString() !== ""
48+
source: root.iconSource
49+
color: root.textColor
50+
size: 24
51+
}
52+
4453
CoreText {
4554
Layout.alignment: Qt.AlignVCenter
4655
text: root.text

qml/pages/wallet/PaymentRequestDetail.qml

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ Page {
173173
Layout.fillWidth: true
174174
visible: root.request !== null && root.request.address !== ""
175175
address: root.request ? root.request.address : ""
176-
onCopied: copiedToast.show(copyButton)
177176
}
178177
}
179178

@@ -223,48 +222,6 @@ Page {
223222
onClicked: root.editRequest()
224223
}
225224

226-
Button {
227-
id: copyButton
228-
objectName: "paymentRequestDetailCopy"
229-
Layout.fillWidth: true
230-
hoverEnabled: AppMode.isDesktop
231-
implicitHeight: 46
232-
Accessible.name: qsTr("Copy payment request")
233-
234-
contentItem: RowLayout {
235-
spacing: 6
236-
Item { Layout.fillWidth: true }
237-
Icon {
238-
source: "qrc:/icons/copy"
239-
color: Theme.color.neutral9
240-
size: 24
241-
}
242-
CoreText {
243-
text: qsTr("Copy")
244-
bold: true
245-
font.pixelSize: 18
246-
color: Theme.color.neutral9
247-
}
248-
Item { Layout.fillWidth: true }
249-
}
250-
251-
background: Rectangle {
252-
implicitHeight: 46
253-
color: Theme.color.background
254-
radius: 5
255-
border.width: 1
256-
border.color: copyButton.pressed ? Theme.color.orangeLight2 : copyButton.hovered ? Theme.color.neutral9 : Theme.color.neutral6
257-
Behavior on border.color { ColorAnimation { duration: 150 } }
258-
}
259-
260-
onClicked: {
261-
if (root.request) {
262-
Clipboard.setText(root.request.qrPayload)
263-
copiedToast.show(copyButton)
264-
}
265-
}
266-
}
267-
268225
Button {
269226
id: qrButton
270227
objectName: "paymentRequestDetailQRButton"
@@ -310,26 +267,13 @@ Page {
310267
}
311268
}
312269

313-
ToastPopup {
314-
id: copiedToast
315-
popupAnchor: copyButton
316-
popupOffset: 4
317-
text: qsTr("Copied")
318-
backgroundColor: Theme.color.green
319-
borderColor: Theme.color.green
320-
textColor: Theme.color.white
321-
iconSource: "image://images/check"
322-
iconColor: Theme.color.white
323-
}
324-
325270
QRCodePopup {
326271
id: qrPopup
327272
code: root.request ? root.request.qrPayload : ""
328273
label: root.request ? root.request.label : ""
329274
onCopyRequested: {
330275
if (root.request) {
331276
Clipboard.setText(root.request.qrPayload)
332-
copiedToast.show(copyButton)
333277
}
334278
qrPopup.close()
335279
}

0 commit comments

Comments
 (0)