receive: add "Download QR-Code image" and "Copy Payment URL" buttons

This commit is contained in:
xiphon 2019-01-10 14:57:28 +00:00
parent 36eb1f80e1
commit ba2815b6c9
6 changed files with 39 additions and 69 deletions

BIN
images/download-white.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 255 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 323 B

View file

@ -270,83 +270,49 @@ Rectangle {
} }
} }
RowLayout { ColumnLayout {
Layout.topMargin: 22 * scaleRatio Layout.alignment: Qt.AlignHCenter
MoneroComponents.CheckBox2 { spacing: 11 * scaleRatio
id: showAdvancedCheckbox property int qrSize: 220 * scaleRatio
checked: persistentSettings.receiveShowAdvanced
onClicked: {
persistentSettings.receiveShowAdvanced = !persistentSettings.receiveShowAdvanced
}
text: qsTr("Advanced options") + translationManager.emptyString
}
}
RowLayout { Rectangle {
Layout.topMargin: 6 * scaleRatio id: qrContainer
visible: persistentSettings.receiveShowAdvanced color: "white"
Layout.fillWidth: true
MoneroComponents.LineEditMulti {
id: paymentUrl
Layout.fillWidth: true Layout.fillWidth: true
Layout.maximumWidth: parent.qrSize
Layout.preferredHeight: width
radius: 4 * scaleRatio
labelText: qsTr("Payment URL") + translationManager.emptyString Image {
text: TxUtils.makeQRCodeString(appWindow.current_address) id: qrCode
readOnly: true anchors.fill: parent
copyButton: true anchors.margins: 1 * scaleRatio
wrapMode: Text.WrapAnywhere
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 { RowLayout {
property int qrSize: 220 * scaleRatio spacing: parent.spacing
Layout.fillWidth: true
Rectangle { MoneroComponents.StandardButton {
id: qrContainer rightIcon: "../images/download-white.png"
radius: 4 * scaleRatio onClicked: qrFileDialog.open()
color: "white" }
Layout.preferredWidth: parent.qrSize
Layout.preferredHeight: parent.qrSize
Image { MoneroComponents.StandardButton {
id: qrCode rightIcon: "../images/external-link-white.png"
anchors.fill: parent onClicked: {
anchors.margins: 1 * scaleRatio clipboard.setText(TxUtils.makeQRCodeString(appWindow.current_address));
appWindow.showStatusMessage(qsTr("Copied to clipboard"), 3);
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()
}
} }
} }
} }

View file

@ -5,6 +5,10 @@
<file>RightPanel.qml</file> <file>RightPanel.qml</file>
<file>MiddlePanel.qml</file> <file>MiddlePanel.qml</file>
<file>images/closeIcon.png</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/helpIcon.png</file>
<file>images/maximizeIcon.png</file> <file>images/maximizeIcon.png</file>
<file>images/minimizeIcon.png</file> <file>images/minimizeIcon.png</file>