Dynamic subaddr table height, dont show history table when there is none

This commit is contained in:
Sander Ferdinand 2018-03-21 02:39:09 +01:00 committed by moneromooo-monero
parent 57c0477fc6
commit 5213daad77
5 changed files with 28 additions and 15 deletions

View File

@ -28,6 +28,7 @@
import QtQuick 2.0 import QtQuick 2.0
import moneroComponents.Clipboard 1.0 import moneroComponents.Clipboard 1.0
import "../components"
import "." 1.0 import "." 1.0
ListView { ListView {
@ -42,7 +43,7 @@ ListView {
delegate: Rectangle { delegate: Rectangle {
id: delegate id: delegate
height: 74 height: 74
color: 'black'; color: 'transparent';
anchors.topMargin: 0 anchors.topMargin: 0
width: listView.width width: listView.width
@ -57,9 +58,8 @@ ListView {
anchors.right: parent.right anchors.right: parent.right
anchors.leftMargin: 5 anchors.leftMargin: 5
anchors.topMargin: 12 anchors.topMargin: 12
anchors.rightMargin: 40 anchors.rightMargin: 44
anchors.bottomMargin: 0 anchors.bottomMargin: 0
onTextChanged: cursorPosition = 0
text: address text: address
showingHeader: false showingHeader: false

View File

@ -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 { GridLayout {
id: tableHeader id: tableHeader
columns: 1 columns: 1
@ -274,6 +284,7 @@ Rectangle {
Rectangle { Rectangle {
id: header id: header
Layout.fillWidth: true Layout.fillWidth: true
visible: table.count > 0
height: 10 height: 10
color: "transparent" color: "transparent"

View File

@ -171,6 +171,7 @@ Rectangle {
id: header id: header
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 10 Layout.topMargin: 10
visible: table.count > 0
height: 10 height: 10
color: "transparent" color: "transparent"
@ -210,8 +211,9 @@ Rectangle {
Rectangle { Rectangle {
id: tableRect id: tableRect
property int table_max_height: 240
Layout.fillWidth: true Layout.fillWidth: true
Layout.preferredHeight: 240 Layout.preferredHeight: table.contentHeight < table_max_height ? table.contentHeight : table_max_height
color: "transparent" color: "transparent"
Scroll { Scroll {

View File

@ -202,7 +202,7 @@ Rectangle {
id: addressLineRow id: addressLineRow
Layout.fillWidth: true Layout.fillWidth: true
LineEditMulti{ LineEditMulti {
id: addressLine id: addressLine
spacing: 0 spacing: 0
inputLabelText: qsTr("<style type='text/css'>a {text-decoration: none; color: #858585; font-size: 14px;}</style>\ inputLabelText: qsTr("<style type='text/css'>a {text-decoration: none; color: #858585; font-size: 14px;}</style>\

View File

@ -45,12 +45,12 @@ Rectangle {
/* main layout */ /* main layout */
ColumnLayout { ColumnLayout {
id: mainLayout id: mainLayout
anchors.margins: 40 anchors.margins: 40 * scaleRatio
anchors.left: parent.left anchors.left: parent.left
anchors.top: parent.top anchors.top: parent.top
anchors.right: parent.right anchors.right: parent.right
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
spacing: 20 spacing: 20 * scaleRatio
// solo // solo
ColumnLayout { ColumnLayout {
@ -58,11 +58,11 @@ Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
spacing: 20 spacing: 20 * scaleRatio
Label { Label {
id: soloTitleLabel id: soloTitleLabel
fontSize: 24 fontSize: 24 * scaleRatio
text: qsTr("Prove Transaction") + translationManager.emptyString text: qsTr("Prove Transaction") + translationManager.emptyString
} }
@ -115,8 +115,8 @@ Rectangle {
StandardButton { StandardButton {
anchors.left: parent.left anchors.left: parent.left
anchors.topMargin: 17 anchors.topMargin: 17 * scaleRatio
width: 60 width: 60 * scaleRatio
text: qsTr("Generate") + translationManager.emptyString text: qsTr("Generate") + translationManager.emptyString
enabled: TxUtils.checkTxID(getProofTxIdLine.text) && (getProofAddressLine.text.length == 0 || TxUtils.checkAddress(getProofAddressLine.text, appWindow.persistentSettings.testnet)) enabled: TxUtils.checkTxID(getProofTxIdLine.text) && (getProofAddressLine.text.length == 0 || TxUtils.checkAddress(getProofAddressLine.text, appWindow.persistentSettings.testnet))
onClicked: { onClicked: {
@ -131,13 +131,13 @@ Rectangle {
color: "#404040" color: "#404040"
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
anchors.bottomMargin: 3 anchors.bottomMargin: 3 * scaleRatio
} }
Label { Label {
id: soloTitleLabel2 id: soloTitleLabel2
fontSize: 24 fontSize: 24 * scaleRatio
text: qsTr("Check Transaction") + translationManager.emptyString text: qsTr("Check Transaction") + translationManager.emptyString
} }
@ -205,7 +205,7 @@ Rectangle {
StandardButton { StandardButton {
anchors.left: parent.left anchors.left: parent.left
anchors.topMargin: 17 anchors.topMargin: 17 * scaleRatio
width: 60 width: 60
text: qsTr("Check") + translationManager.emptyString 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))) 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" color: "#404040"
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
anchors.bottomMargin: 3 anchors.bottomMargin: 3 * scaleRatio
} }