From ba2815b6c9fc6337b662cd7ef3e2cf02192aab99 Mon Sep 17 00:00:00 2001 From: xiphon Date: Thu, 10 Jan 2019 14:57:28 +0000 Subject: [PATCH] receive: add "Download QR-Code image" and "Copy Payment URL" buttons --- images/download-white.png | Bin 0 -> 214 bytes images/download-white@2x.png | Bin 0 -> 255 bytes images/external-link-white.png | Bin 0 -> 246 bytes images/external-link-white@2x.png | Bin 0 -> 323 bytes pages/Receive.qml | 104 ++++++++++-------------------- qml.qrc | 4 ++ 6 files changed, 39 insertions(+), 69 deletions(-) create mode 100644 images/download-white.png create mode 100644 images/download-white@2x.png create mode 100644 images/external-link-white.png create mode 100644 images/external-link-white@2x.png diff --git a/images/download-white.png b/images/download-white.png new file mode 100644 index 0000000000000000000000000000000000000000..a86213523105d4f2dbf9c2be3118cda87bafca13 GIT binary patch literal 214 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ z$hLzpWB=2SsX#%=64!{5;QX|b^2DN4hVt@qz0ADq;^f4FRK5J7^x5xhq=1ToJzX3_ zEPCHg+Q@f6frGX7-|NhU5sV=PN(VW1PysVC_9=d-!69X~G7K3lb&7D~on+ zH57Vq`s9h-Hl0tNC~Q)j?ZN&_y;Ay9-o8Wc{r50-SGbL4AK;9(7Xy)^dJ+2dmO>uv;^SqBk{bS|t`|KCpXXN`f#dGTZecr-AcQAOm`njxgN@xNAPXS%F literal 0 HcmV?d00001 diff --git a/images/external-link-white.png b/images/external-link-white.png new file mode 100644 index 0000000000000000000000000000000000000000..e771b8d1693edc290193014c62ab53c8e5db7209 GIT binary patch literal 246 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#Vf4nJ z$hLzpWB=2SsX#%=64!{5;QX|b^2DN4hVt@qz0ADq;^f4FRK5J7^x5xhq=1TwJzX3_ zEPB@lS@Ja)@OTS&$KTnQ`s8Zb!k~^Kk*?)lb}8YC8WWfrR+;kGicM$@NSVWV(`d27 z$4Qsj7=AtHY}zopr0KnK*TmS$7 literal 0 HcmV?d00001 diff --git a/images/external-link-white@2x.png b/images/external-link-white@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..b0a72f96d4f82d8ef5bff6a88585e2fb4e38d57a GIT binary patch literal 323 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdzmSQK*5Dp-y;YjHK@;M7UB8wRq ztocBg@yxb`%|JoP64!{5;QX|b^2DN4hVt@qz0ADq;^f4FRK5J7^x5xhq=1SJc)B=- zM6|xWx|^@rfQL0edgGIBYo_G=w_>|mK5bclH?32h?Srk~A_pT4sVNfen)-&teKLzZCBRU9p_%4_d{UO)cHGKYHwgTYWv~+tbI(}9~k#dU3W7oWU&^| OFAScpelF{r5}E)JGI!bl literal 0 HcmV?d00001 diff --git a/pages/Receive.qml b/pages/Receive.qml index 2c840ab4..ee0a2554 100644 --- a/pages/Receive.qml +++ b/pages/Receive.qml @@ -270,83 +270,49 @@ Rectangle { } } - RowLayout { - Layout.topMargin: 22 * scaleRatio - MoneroComponents.CheckBox2 { - id: showAdvancedCheckbox - checked: persistentSettings.receiveShowAdvanced - onClicked: { - persistentSettings.receiveShowAdvanced = !persistentSettings.receiveShowAdvanced - } - text: qsTr("Advanced options") + translationManager.emptyString - } - } + ColumnLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 11 * scaleRatio + property int qrSize: 220 * scaleRatio - RowLayout { - Layout.topMargin: 6 * scaleRatio - visible: persistentSettings.receiveShowAdvanced - Layout.fillWidth: true - - MoneroComponents.LineEditMulti { - id: paymentUrl + Rectangle { + id: qrContainer + color: "white" Layout.fillWidth: true + Layout.maximumWidth: parent.qrSize + Layout.preferredHeight: width + radius: 4 * scaleRatio - labelText: qsTr("Payment URL") + translationManager.emptyString - text: TxUtils.makeQRCodeString(appWindow.current_address) - readOnly: true - copyButton: true - wrapMode: Text.WrapAnywhere + Image { + id: qrCode + anchors.fill: parent + anchors.margins: 1 * scaleRatio + + smooth: false + fillMode: Image.PreserveAspectFit + source: "image://qrcode/" + TxUtils.makeQRCodeString(appWindow.current_address) + + MouseArea { + anchors.fill: parent + acceptedButtons: Qt.RightButton + onPressAndHold: qrFileDialog.open() + } + } } - } - - GridLayout{ - visible: persistentSettings.receiveShowAdvanced - Layout.topMargin: 10 * scaleRatio - columns: 2 - columnSpacing: 30 * scaleRatio RowLayout { - property int qrSize: 220 * scaleRatio - Layout.fillWidth: true + spacing: parent.spacing - Rectangle { - id: qrContainer - radius: 4 * scaleRatio - color: "white" - Layout.preferredWidth: parent.qrSize - Layout.preferredHeight: parent.qrSize + MoneroComponents.StandardButton { + rightIcon: "../images/download-white.png" + onClicked: qrFileDialog.open() + } - Image { - id: qrCode - anchors.fill: parent - anchors.margins: 1 * scaleRatio - - smooth: false - fillMode: Image.PreserveAspectFit - source: "image://qrcode/" + TxUtils.makeQRCodeString(appWindow.current_address) - - MouseArea { - anchors.fill: parent - acceptedButtons: Qt.RightButton - onClicked: { - if (mouse.button == Qt.RightButton){ - qrMenu.x = this.mouseX; - qrMenu.y = this.mouseY; - qrMenu.open() - } - } - onPressAndHold: qrFileDialog.open() - } - } - - Menu { - id: qrMenu - title: "QrCode" - - MenuItem { - text: qsTr("Save As") + translationManager.emptyString; - onTriggered: qrFileDialog.open() - } + MoneroComponents.StandardButton { + rightIcon: "../images/external-link-white.png" + onClicked: { + clipboard.setText(TxUtils.makeQRCodeString(appWindow.current_address)); + appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3); } } } diff --git a/qml.qrc b/qml.qrc index f2c1cf4f..d6d37619 100644 --- a/qml.qrc +++ b/qml.qrc @@ -5,6 +5,10 @@ RightPanel.qml MiddlePanel.qml images/closeIcon.png + images/download-white.png + images/download-white@2x.png + images/external-link-white.png + images/external-link-white@2x.png images/helpIcon.png images/maximizeIcon.png images/minimizeIcon.png