Transfer: address book inline button, 2nd inline button, scan QR code button fixes

spacing fix
This commit is contained in:
rating89us 2020-04-14 20:47:00 +02:00 committed by rating89us
parent 8e4124f06a
commit de6a9b6779
3 changed files with 28 additions and 12 deletions

View file

@ -53,6 +53,7 @@ Item {
property alias fontPixelSize: inlineText.font.pixelSize property alias fontPixelSize: inlineText.font.pixelSize
property alias fontFamily: inlineText.font.family property alias fontFamily: inlineText.font.family
property alias buttonColor: rect.color property alias buttonColor: rect.color
property alias buttonHeight: rect.height
signal clicked() signal clicked()
function doClick() { function doClick() {

View file

@ -87,6 +87,8 @@ ColumnLayout {
property alias inlineButton: inlineButtonId property alias inlineButton: inlineButtonId
property bool inlineButtonVisible: false property bool inlineButtonVisible: false
property alias inlineButton2: inlineButton2Id
property bool inlineButton2Visible: false
signal labelButtonClicked(); signal labelButtonClicked();
signal inputLabelLinkActivated(); signal inputLabelLinkActivated();
@ -202,5 +204,12 @@ ColumnLayout {
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: 8 anchors.rightMargin: 8
} }
MoneroComponents.InlineButton {
id: inlineButton2Id
visible: (inlineButton2Id.text || inlineButton2Id.icon) && inlineButton2Visible ? true : false
anchors.right: parent.right
anchors.rightMargin: inlineButtonVisible ? 48 : 8
}
} }
} }

View file

@ -307,10 +307,9 @@ Rectangle {
LineEditMulti { LineEditMulti {
id: addressLine id: addressLine
spacing: 0 spacing: 0
inputPaddingRight: inlineButtonVisible && inlineButton2Visible ? 100 : 60
fontBold: true fontBold: true
labelText: qsTr("<style type='text/css'>a {text-decoration: none; color: #858585; font-size: 14px;}</style>\ labelText: qsTr("Address") + translationManager.emptyString
%1 <a href='#'>(%2)</a>").arg(qsTr("Address")).arg(qsTr("Address book"))
+ translationManager.emptyString
labelButtonText: qsTr("Resolve") + translationManager.emptyString labelButtonText: qsTr("Resolve") + translationManager.emptyString
placeholderText: { placeholderText: {
if(persistentSettings.nettype == NetworkType.MAINNET){ if(persistentSettings.nettype == NetworkType.MAINNET){
@ -323,10 +322,6 @@ Rectangle {
} }
wrapMode: Text.WrapAnywhere wrapMode: Text.WrapAnywhere
addressValidation: true addressValidation: true
onInputLabelLinkActivated: {
middlePanel.addressBookView.selectAndSend = true;
appWindow.showPageRequest("AddressBook");
}
onTextChanged: { onTextChanged: {
const parsed = walletManager.parse_uri_to_object(text); const parsed = walletManager.parse_uri_to_object(text);
if (!parsed.error) { if (!parsed.error) {
@ -336,16 +331,27 @@ Rectangle {
setDescription(parsed.tx_description); setDescription(parsed.tx_description);
} }
} }
inlineButton.text: FontAwesome.qrcode inlineButton.text: FontAwesome.addressBook
inlineButton.buttonHeight: 30
inlineButton.fontPixelSize: 22 inlineButton.fontPixelSize: 22
inlineButton.fontFamily: FontAwesome.fontFamily inlineButton.fontFamily: FontAwesome.fontFamily
inlineButton.textColor: MoneroComponents.Style.defaultFontColor inlineButton.textColor: MoneroComponents.Style.defaultFontColor
inlineButton.buttonColor: MoneroComponents.Style.orange
inlineButton.onClicked: { inlineButton.onClicked: {
cameraUi.state = "Capture" middlePanel.addressBookView.selectAndSend = true;
cameraUi.qrcode_decoded.connect(updateFromQrCode) appWindow.showPageRequest("AddressBook");
} }
inlineButtonVisible : appWindow.qrScannerEnabled && !addressLine.text inlineButtonVisible: true
inlineButton2.text: FontAwesome.qrcode
inlineButton2.buttonHeight: 30
inlineButton2.fontPixelSize: 22
inlineButton2.fontFamily: FontAwesome.fontFamily
inlineButton2.textColor: MoneroComponents.Style.defaultFontColor
inlineButton2.onClicked: {
cameraUi.state = "Capture"
cameraUi.qrcode_decoded.connect(updateFromQrCode)
}
inlineButton2Visible: appWindow.qrScannerEnabled
} }
} }