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 diff --git a/main.qml b/main.qml index 3b57a523..d23069d0 100644 --- a/main.qml +++ b/main.qml @@ -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;