diff options
| author | luigi1111 <luigi1111w@gmail.com> | 2019-01-21 14:43:35 -0600 |
|---|---|---|
| committer | luigi1111 <luigi1111w@gmail.com> | 2019-01-21 14:43:35 -0600 |
| commit | eb028646b22c4bc36ced5c4839c7b323aadfd40d (patch) | |
| tree | 240af6ea18302136c2975eb143dd6ebfd9e5a4ec | |
| parent | 36eb1f80e1c070f753746519e2c9e4f01784f6c2 (diff) | |
| parent | ba2815b6c9fc6337b662cd7ef3e2cf02192aab99 (diff) | |
| download | monzero-gui-eb028646b22c4bc36ced5c4839c7b323aadfd40d.tar.gz monzero-gui-eb028646b22c4bc36ced5c4839c7b323aadfd40d.tar.xz monzero-gui-eb028646b22c4bc36ced5c4839c7b323aadfd40d.zip | |
Merge pull request #1836
ba2815b receive: add 'Download QR-Code image' and 'Copy Payment URL' buttons (xiphon)
| -rw-r--r-- | images/download-white.png | bin | 0 -> 214 bytes | |||
| -rw-r--r-- | images/download-white@2x.png | bin | 0 -> 255 bytes | |||
| -rw-r--r-- | images/external-link-white.png | bin | 0 -> 246 bytes | |||
| -rw-r--r-- | images/external-link-white@2x.png | bin | 0 -> 323 bytes | |||
| -rw-r--r-- | pages/Receive.qml | 102 | ||||
| -rw-r--r-- | qml.qrc | 4 |
6 files changed, 38 insertions, 68 deletions
diff --git a/images/download-white.png b/images/download-white.png Binary files differnew file mode 100644 index 00000000..a8621352 --- /dev/null +++ b/images/download-white.png diff --git a/images/download-white@2x.png b/images/download-white@2x.png Binary files differnew file mode 100644 index 00000000..c91be23b --- /dev/null +++ b/images/download-white@2x.png diff --git a/images/external-link-white.png b/images/external-link-white.png Binary files differnew file mode 100644 index 00000000..e771b8d1 --- /dev/null +++ b/images/external-link-white.png diff --git a/images/external-link-white@2x.png b/images/external-link-white@2x.png Binary files differnew file mode 100644 index 00000000..b0a72f96 --- /dev/null +++ b/images/external-link-white@2x.png 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 - } - } - - RowLayout { - Layout.topMargin: 6 * scaleRatio - visible: persistentSettings.receiveShowAdvanced - Layout.fillWidth: true + ColumnLayout { + Layout.alignment: Qt.AlignHCenter + spacing: 11 * scaleRatio + property int qrSize: 220 * scaleRatio - 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 - } - } - - GridLayout{ - visible: persistentSettings.receiveShowAdvanced - Layout.topMargin: 10 * scaleRatio - columns: 2 - columnSpacing: 30 * scaleRatio - - RowLayout { - property int qrSize: 220 * scaleRatio - Layout.fillWidth: true + Image { + id: qrCode + anchors.fill: parent + anchors.margins: 1 * scaleRatio - Rectangle { - id: qrContainer - radius: 4 * scaleRatio - color: "white" - Layout.preferredWidth: parent.qrSize - Layout.preferredHeight: parent.qrSize + smooth: false + fillMode: Image.PreserveAspectFit + source: "image://qrcode/" + TxUtils.makeQRCodeString(appWindow.current_address) - Image { - id: qrCode + MouseArea { 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() - } + acceptedButtons: Qt.RightButton + onPressAndHold: qrFileDialog.open() } + } + } + + RowLayout { + spacing: parent.spacing - Menu { - id: qrMenu - title: "QrCode" + MoneroComponents.StandardButton { + rightIcon: "../images/download-white.png" + onClicked: qrFileDialog.open() + } - 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); } } } @@ -5,6 +5,10 @@ <file>RightPanel.qml</file> <file>MiddlePanel.qml</file> <file>images/closeIcon.png</file> + <file>images/download-white.png</file> + <file>images/download-white@2x.png</file> + <file>images/external-link-white.png</file> + <file>images/external-link-white@2x.png</file> <file>images/helpIcon.png</file> <file>images/maximizeIcon.png</file> <file>images/minimizeIcon.png</file> |
