Skip to content

Commit 2c2988b

Browse files
committed
Simplify watch only balance display logic
Instead of making the watch-only balances independent, make them inherit their visible state from non watch-only balances. This prevents the situation where a watch-only line item is blank.
1 parent 45a1537 commit 2c2988b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/qt/overviewpage.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -281,28 +281,28 @@ void OverviewPage::setBalance(const CAmount& balance, const CAmount& unconfirmed
281281

282282
// PIV Available
283283
bool showPIVAvailable = settingShowAllBalances || pivAvailableBalance != nTotalBalance;
284-
bool showWatchOnlyPIVAvailable = settingShowAllBalances || nAvailableWatchBalance != nTotalWatchBalance;
284+
bool showWatchOnlyPIVAvailable = showPIVAvailable || nAvailableWatchBalance != nTotalWatchBalance;
285285
ui->labelBalanceText->setVisible(showPIVAvailable || showWatchOnlyPIVAvailable);
286286
ui->labelBalance->setVisible(showPIVAvailable || showWatchOnlyPIVAvailable);
287287
ui->labelWatchAvailable->setVisible(showWatchOnlyPIVAvailable && showWatchOnly);
288288

289289
// PIV Pending
290290
bool showPIVPending = settingShowAllBalances || unconfirmedBalance != 0;
291-
bool showWatchOnlyPIVPending = settingShowAllBalances || watchUnconfBalance != 0;
291+
bool showWatchOnlyPIVPending = showPIVPending || watchUnconfBalance != 0;
292292
ui->labelPendingText->setVisible(showPIVPending || showWatchOnlyPIVPending);
293293
ui->labelUnconfirmed->setVisible(showPIVPending || showWatchOnlyPIVPending);
294294
ui->labelWatchPending->setVisible(showWatchOnlyPIVPending && showWatchOnly);
295295

296296
// PIV Immature
297297
bool showPIVImmature = settingShowAllBalances || immatureBalance != 0;
298-
bool showWatchOnlyImmature = settingShowAllBalances || watchImmatureBalance != 0;
298+
bool showWatchOnlyImmature = showPIVImmature || watchImmatureBalance != 0;
299299
ui->labelImmatureText->setVisible(showPIVImmature || showWatchOnlyImmature);
300300
ui->labelImmature->setVisible(showPIVImmature || showWatchOnlyImmature); // for symmetry reasons also show immature label when the watch-only one is shown
301301
ui->labelWatchImmature->setVisible(showWatchOnlyImmature && showWatchOnly); // show watch-only immature balance
302302

303303
// PIV Locked
304304
bool showPIVLocked = settingShowAllBalances || nLockedBalance != 0;
305-
bool showWatchOnlyPIVLocked = settingShowAllBalances || nWatchOnlyLockedBalance != 0;
305+
bool showWatchOnlyPIVLocked = showPIVLocked || nWatchOnlyLockedBalance != 0;
306306
ui->labelLockedBalanceText->setVisible(showPIVLocked || showWatchOnlyPIVLocked);
307307
ui->labelLockedBalance->setVisible(showPIVLocked || showWatchOnlyPIVLocked);
308308
ui->labelWatchLocked->setVisible(showWatchOnlyPIVLocked && showWatchOnly);

0 commit comments

Comments
 (0)