receive: fix Amount and QR-Code layout

This commit is contained in:
xiphon 2018-10-27 12:27:18 +00:00
parent 3aa6da058a
commit 12a3d687c6

View File

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