diff options
| author | Sander Ferdinand <sa.ferdinand@gmail.com> | 2017-11-23 15:28:52 +0100 |
|---|---|---|
| committer | moneromooo-monero <moneromooo-monero@users.noreply.github.com> | 2018-03-29 23:04:00 +0100 |
| commit | dc445edaae6dd7cb98b5337566aa4a5495e97b6b (patch) | |
| tree | 8d42010b910bceae7c5213480288910600e8955e | |
| parent | 2e89f86b9fce8c8f1ebff0f0aad53d21303352f1 (diff) | |
| download | monzero-gui-dc445edaae6dd7cb98b5337566aa4a5495e97b6b.tar.gz monzero-gui-dc445edaae6dd7cb98b5337566aa4a5495e97b6b.tar.xz monzero-gui-dc445edaae6dd7cb98b5337566aa4a5495e97b6b.zip | |
Hide 'unlocked balance' when no funds are available
| -rw-r--r-- | LeftPanel.qml | 4 | ||||
| -rw-r--r-- | main.qml | 17 |
2 files changed, 21 insertions, 0 deletions
diff --git a/LeftPanel.qml b/LeftPanel.qml index fd9b880c..51d0d70d 100644 --- a/LeftPanel.qml +++ b/LeftPanel.qml @@ -36,6 +36,8 @@ Rectangle { id: panel property alias unlockedBalanceText: unlockedBalanceText.text + property alias unlockedBalanceVisible: unlockedBalanceText.visible + property alias unlockedBalanceLabelVisible: unlockedBalanceLabel.visible property alias balanceLabelText: balanceLabel.text property alias balanceText: balanceText.text property alias networkStatus : networkStatus @@ -176,6 +178,7 @@ Rectangle { Text { id: unlockedBalanceText + visible: false anchors.left: parent.left anchors.leftMargin: 20 anchors.top: parent.top @@ -196,6 +199,7 @@ Rectangle { Label { id: unlockedBalanceLabel + visible: false text: qsTr("Unlocked balance") + translationManager.emptyString anchors.left: parent.left anchors.leftMargin: 20 @@ -381,6 +381,23 @@ ApplicationWindow { function onWalletUpdate() { console.log(">>> wallet updated") updateBalance(); + var unlockedBalance = walletManager.displayAmount(currentWallet.unlockedBalance); + var unlockedBalanceFloat = parseFloat(unlockedBalance); + + if(unlockedBalanceFloat === 0){ + // no available funds; hide the 'unlocked balance' label + leftPanel.unlockedBalanceVisible = false + leftPanel.unlockedBalanceLabelVisible = false + } else { + leftPanel.unlockedBalanceVisible = true + leftPanel.unlockedBalanceLabelVisible = true + leftPanel.unlockedBalanceText.text = unlockedBalance + } + + // showing middlePanel unlockedBalance regardless + middlePanel.unlockedBalanceText = leftPanel.unlockedBalanceText = unlockedBalance; + middlePanel.balanceText = leftPanel.balanceText = walletManager.displayAmount(currentWallet.balance); + // Update history if new block found since last update if(foundNewBlock) { foundNewBlock = false; |
