Skip to content

Commit 34211b6

Browse files
kwvgUdjinM6
andcommitted
qt: apply monospace font to overview page balances and CoinJoin elements
Co-authored-by: UdjinM6 <[email protected]>
1 parent 6ed53d6 commit 34211b6

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

src/qt/overviewpage.cpp

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,7 @@ OverviewPage::OverviewPage(QWidget* parent) :
155155
ui->labelCoinJoinHeader
156156
}, {GUIUtil::g_font_registry.GetWeightBold(), 16});
157157

158-
GUIUtil::setFont({ui->labelTotalText,
159-
ui->labelWatchTotal,
160-
ui->labelTotal
161-
}, {GUIUtil::g_font_registry.GetWeightBold(), 14});
158+
GUIUtil::setFont({ui->labelTotalText}, {GUIUtil::g_font_registry.GetWeightBold(), 14});
162159

163160
GUIUtil::setFont({ui->labelBalanceText,
164161
ui->labelPendingText,
@@ -167,7 +164,8 @@ OverviewPage::OverviewPage(QWidget* parent) :
167164
ui->labelSpendable
168165
}, {GUIUtil::g_font_registry.GetWeightBold()});
169166

170-
GUIUtil::updateFonts();
167+
// Calls GUIUtil::updateFonts() internally
168+
setMonospacedFont(/*use_embedded_font=*/false);
171169

172170
m_balances.balance = -1;
173171

@@ -304,6 +302,7 @@ void OverviewPage::setClientModel(ClientModel *model)
304302
// Show warning, for example if this is a prerelease version
305303
connect(model, &ClientModel::alertsChanged, this, &OverviewPage::updateAlerts);
306304
updateAlerts(model->getStatusBarWarnings());
305+
setMonospacedFont(/*use_embedded_font=*/false);
307306
// explicitly update CoinJoin frame and transaction list to reflect actual settings
308307
updateAdvancedCJUI(model->getOptionsModel()->getShowAdvancedCJUI());
309308
}
@@ -376,6 +375,28 @@ void OverviewPage::showOutOfSyncWarning(bool fShow)
376375
ui->labelTransactionsStatus->setVisible(fShow);
377376
}
378377

378+
void OverviewPage::setMonospacedFont(bool use_embedded_font)
379+
{
380+
GUIUtil::setFont({
381+
ui->labelTotal,
382+
ui->labelWatchTotal,
383+
}, {GUIUtil::fixedPitchFont(use_embedded_font).family(), GUIUtil::g_font_registry.GetWeightBold(), 14});
384+
385+
GUIUtil::setFont({
386+
ui->labelAmountRounds,
387+
ui->labelAnonymized,
388+
ui->labelBalance,
389+
ui->labelUnconfirmed,
390+
ui->labelImmature,
391+
ui->labelSubmittedDenom,
392+
ui->labelWatchAvailable,
393+
ui->labelWatchPending,
394+
ui->labelWatchImmature,
395+
}, {GUIUtil::fixedPitchFont(use_embedded_font).family(), GUIUtil::g_font_registry.GetWeightBold()});
396+
397+
GUIUtil::updateFonts();
398+
}
399+
379400
void OverviewPage::updateCoinJoinProgress()
380401
{
381402
if (!walletModel || !clientModel || clientModel->node().shutdownRequested() || !clientModel->masternodeSync().isBlockchainSynced()) return;

src/qt/overviewpage.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ private Q_SLOTS:
7171
void handleTransactionClicked(const QModelIndex &index);
7272
void updateAlerts(const QString &warnings);
7373
void updateWatchOnlyLabels(bool showWatchOnly);
74+
void setMonospacedFont(bool use_embedded_font);
7475
};
7576

7677
#endif // BITCOIN_QT_OVERVIEWPAGE_H

0 commit comments

Comments
 (0)