From 5213daad77940ba6162c8c772e5da4213ad6f962 Mon Sep 17 00:00:00 2001 From: Sander Ferdinand Date: Wed, 21 Mar 2018 02:39:09 +0100 Subject: [PATCH] Dynamic subaddr table height, dont show history table when there is none --- components/SubaddressTable.qml | 6 +++--- pages/History.qml | 11 +++++++++++ pages/Receive.qml | 4 +++- pages/Transfer.qml | 2 +- pages/TxKey.qml | 20 ++++++++++---------- 5 files changed, 28 insertions(+), 15 deletions(-) diff --git a/components/SubaddressTable.qml b/components/SubaddressTable.qml index 027a57ad..12f06d1c 100644 --- a/components/SubaddressTable.qml +++ b/components/SubaddressTable.qml @@ -28,6 +28,7 @@ import QtQuick 2.0 import moneroComponents.Clipboard 1.0 +import "../components" import "." 1.0 ListView { @@ -42,7 +43,7 @@ ListView { delegate: Rectangle { id: delegate height: 74 - color: 'black'; + color: 'transparent'; anchors.topMargin: 0 width: listView.width @@ -57,9 +58,8 @@ ListView { anchors.right: parent.right anchors.leftMargin: 5 anchors.topMargin: 12 - anchors.rightMargin: 40 + anchors.rightMargin: 44 anchors.bottomMargin: 0 - onTextChanged: cursorPosition = 0 text: address showingHeader: false diff --git a/pages/History.qml b/pages/History.qml index ad4bbb60..a1f3142a 100644 --- a/pages/History.qml +++ b/pages/History.qml @@ -259,6 +259,16 @@ Rectangle { } } + GridLayout { + Layout.topMargin: 20 + visible: table.count === 0 + + Label { + fontSize: 16 * scaleRatio + text: qsTr("No history yet...") + translationManager.emptyString + } + } + GridLayout { id: tableHeader columns: 1 @@ -274,6 +284,7 @@ Rectangle { Rectangle { id: header Layout.fillWidth: true + visible: table.count > 0 height: 10 color: "transparent" diff --git a/pages/Receive.qml b/pages/Receive.qml index ee028395..774f92c6 100644 --- a/pages/Receive.qml +++ b/pages/Receive.qml @@ -171,6 +171,7 @@ Rectangle { id: header Layout.fillWidth: true Layout.topMargin: 10 + visible: table.count > 0 height: 10 color: "transparent" @@ -210,8 +211,9 @@ Rectangle { Rectangle { id: tableRect + property int table_max_height: 240 Layout.fillWidth: true - Layout.preferredHeight: 240 + Layout.preferredHeight: table.contentHeight < table_max_height ? table.contentHeight : table_max_height color: "transparent" Scroll { diff --git a/pages/Transfer.qml b/pages/Transfer.qml index b5fbfbea..a52a8f92 100644 --- a/pages/Transfer.qml +++ b/pages/Transfer.qml @@ -202,7 +202,7 @@ Rectangle { id: addressLineRow Layout.fillWidth: true - LineEditMulti{ + LineEditMulti { id: addressLine spacing: 0 inputLabelText: qsTr("\ diff --git a/pages/TxKey.qml b/pages/TxKey.qml index a9f571ba..18a65abf 100644 --- a/pages/TxKey.qml +++ b/pages/TxKey.qml @@ -45,12 +45,12 @@ Rectangle { /* main layout */ ColumnLayout { id: mainLayout - anchors.margins: 40 + anchors.margins: 40 * scaleRatio anchors.left: parent.left anchors.top: parent.top anchors.right: parent.right anchors.bottom: parent.bottom - spacing: 20 + spacing: 20 * scaleRatio // solo ColumnLayout { @@ -58,11 +58,11 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right anchors.top: parent.top - spacing: 20 + spacing: 20 * scaleRatio Label { id: soloTitleLabel - fontSize: 24 + fontSize: 24 * scaleRatio text: qsTr("Prove Transaction") + translationManager.emptyString } @@ -115,8 +115,8 @@ Rectangle { StandardButton { anchors.left: parent.left - anchors.topMargin: 17 - width: 60 + anchors.topMargin: 17 * scaleRatio + width: 60 * scaleRatio text: qsTr("Generate") + translationManager.emptyString enabled: TxUtils.checkTxID(getProofTxIdLine.text) && (getProofAddressLine.text.length == 0 || TxUtils.checkAddress(getProofAddressLine.text, appWindow.persistentSettings.testnet)) onClicked: { @@ -131,13 +131,13 @@ Rectangle { color: "#404040" Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter - anchors.bottomMargin: 3 + anchors.bottomMargin: 3 * scaleRatio } Label { id: soloTitleLabel2 - fontSize: 24 + fontSize: 24 * scaleRatio text: qsTr("Check Transaction") + translationManager.emptyString } @@ -205,7 +205,7 @@ Rectangle { StandardButton { anchors.left: parent.left - anchors.topMargin: 17 + anchors.topMargin: 17 * scaleRatio width: 60 text: qsTr("Check") + translationManager.emptyString enabled: TxUtils.checkTxID(checkProofTxIdLine.text) && TxUtils.checkSignature(checkProofSignatureLine.text) && ((checkProofSignatureLine.text.indexOf("SpendProofV") === 0 && checkProofAddressLine.text.length == 0) || (checkProofSignatureLine.text.indexOf("SpendProofV") !== 0 && TxUtils.checkAddress(checkProofAddressLine.text, appWindow.persistentSettings.testnet))) @@ -221,7 +221,7 @@ Rectangle { color: "#404040" Layout.fillWidth: true Layout.alignment: Qt.AlignHCenter - anchors.bottomMargin: 3 + anchors.bottomMargin: 3 * scaleRatio }