From b758c799d4ca7eeee277e91ec134b58da1b58b74 Mon Sep 17 00:00:00 2001 From: xiphon Date: Tue, 15 Jan 2019 16:48:22 +0000 Subject: AddressBook: hide 'Add' form when invoked from 'Send' tab --- pages/AddressBook.qml | 30 ++++++++++++++++-------------- pages/Transfer.qml | 5 ++++- 2 files changed, 20 insertions(+), 15 deletions(-) (limited to 'pages') diff --git a/pages/AddressBook.qml b/pages/AddressBook.qml index 36de37d5..099c05e7 100644 --- a/pages/AddressBook.qml +++ b/pages/AddressBook.qml @@ -32,18 +32,17 @@ import "../components" import moneroComponents.AddressBook 1.0 import moneroComponents.AddressBookModel 1.0 -Rectangle { +ColumnLayout { id: root - color: "transparent" property var model + property bool selectAndSend: false ColumnLayout { - id: columnLayout - anchors.margins: (isMobile)? 17 * scaleRatio : 20 * scaleRatio - anchors.left: parent.left - anchors.top: parent.top - anchors.right: parent.right + Layout.margins: (isMobile ? 17 : 20) * scaleRatio + Layout.topMargin: 40 * scaleRatio + Layout.fillWidth: true spacing: 26 * scaleRatio + visible: !root.selectAndSend RowLayout { StandardButton { @@ -118,13 +117,11 @@ Rectangle { Rectangle { id: tableRect - anchors.top: columnLayout.bottom - anchors.leftMargin: (isMobile)? 17 : 40 - anchors.rightMargin: (isMobile)? 17 : 40 - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - height: parent.height - addButton.y - addButton.height - 36 * scaleRatio + Layout.leftMargin: (isMobile ? 17 : 40) * scaleRatio + Layout.rightMargin: (isMobile ? 17 : 40) * scaleRatio + Layout.topMargin: (root.selectAndSend ? 40 : 0) * scaleRatio + Layout.fillHeight: true + Layout.fillWidth: true color: "transparent" Behavior on height { @@ -148,6 +145,7 @@ Rectangle { anchors.bottom: parent.bottom onContentYChanged: flickableScroll.flickableContentYChanged() model: root.model + selectAndSend: root.selectAndSend } } @@ -167,6 +165,10 @@ Rectangle { return address_ok && payment_id_ok } + function onPageClosed() { + root.selectAndSend = false; + } + function onPageCompleted() { console.log("adress book"); root.model = currentWallet.addressBookModel; diff --git a/pages/Transfer.qml b/pages/Transfer.qml index adad5fd2..a93fff1b 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -213,7 +213,10 @@ Rectangle { placeholderText: "4.. / 8.." wrapMode: Text.WrapAnywhere addressValidation: true - onInputLabelLinkActivated: { appWindow.showPageRequest("AddressBook") } + onInputLabelLinkActivated: { + middlePanel.addressBookView.selectAndSend = true; + appWindow.showPageRequest("AddressBook"); + } pasteButton: true onPaste: function(clipboardText) { const parsed = walletManager.parse_uri_to_object(clipboardText); -- cgit v1.2.3