Merge pull request #1706

12a3d68 receive: fix Amount and QR-Code layout (xiphon)
3b36dc9 receive: add Payment URL (xiphon)
This commit is contained in:
luigi1111 2018-11-25 18:33:47 -06:00
commit 0b73229f6c
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -443,7 +443,7 @@ Rectangle {
Layout.fillWidth: true
Layout.minimumWidth: 200
Layout.maximumWidth: mainLayout.qrCodeSize
spacing: parent.spacing
LineEdit {
id: amountToReceiveLine
@ -456,44 +456,54 @@ Rectangle {
regExp: /(\d{1,8})([.]\d{1,12})?$/
}
}
}
Rectangle {
color: "white"
Layout.topMargin: parent.spacing - 4
Layout.fillWidth: true
Layout.maximumWidth: mainLayout.qrCodeSize
Layout.preferredHeight: width
radius: 4
Rectangle {
color: "white"
Image {
id: qrCode
anchors.fill: parent
anchors.margins: 1
Layout.fillWidth: true
Layout.maximumWidth: mainLayout.qrCodeSize
Layout.preferredHeight: width
radius: 4
smooth: false
fillMode: Image.PreserveAspectFit
source: "image://qrcode/" + makeQRCodeString()
MouseArea {
Image {
id: qrCode
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: {
if (mouse.button == Qt.RightButton)
qrMenu.open()
anchors.margins: 1
smooth: false
fillMode: Image.PreserveAspectFit
source: "image://qrcode/" + makeQRCodeString()
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.RightButton
onClicked: {
if (mouse.button == Qt.RightButton)
qrMenu.open()
}
onPressAndHold: qrFileDialog.open()
}
}
Menu {
id: qrMenu
title: "QrCode"
y: parent.height / 2
MenuItem {
text: qsTr("Save As") + translationManager.emptyString;
onTriggered: qrFileDialog.open()
}
onPressAndHold: qrFileDialog.open()
}
}
Menu {
id: qrMenu
title: "QrCode"
y: parent.height / 2
MenuItem {
text: qsTr("Save As") + translationManager.emptyString;
onTriggered: qrFileDialog.open()
}
LineEdit {
id: paymentUrl
Layout.fillWidth: true
labelText: qsTr("Payment URL") + translationManager.emptyString
text: makeQRCodeString()
onTextUpdated: function() { paymentUrl.cursorPosition = 0; }
readOnly: true
copyButton: true
}
}
}