aboutsummaryrefslogtreecommitdiff
path: root/src/qt/overviewpage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/overviewpage.cpp')
-rw-r--r--src/qt/overviewpage.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp
index bc542a0833..27783bdf87 100644
--- a/src/qt/overviewpage.cpp
+++ b/src/qt/overviewpage.cpp
@@ -78,6 +78,7 @@ public:
{
QIcon iconWatchonly = qvariant_cast<QIcon>(index.data(TransactionTableModel::WatchonlyDecorationRole));
QRect watchonlyRect(boundingRect.right() + 5, mainRect.top()+ypad+halfheight, 16, halfheight);
+ iconWatchonly = platformStyle->TextColorIcon(iconWatchonly);
iconWatchonly.paint(painter, watchonlyRect);
address_rect_min_width += 5 + watchonlyRect.width();
}
@@ -143,6 +144,7 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)
ui(new Ui::OverviewPage),
clientModel(nullptr),
walletModel(nullptr),
+ m_platform_style{platformStyle},
txdelegate(new TxViewDelegate(platformStyle, this))
{
ui->setupUi(this);
@@ -150,7 +152,7 @@ OverviewPage::OverviewPage(const PlatformStyle *platformStyle, QWidget *parent)
m_balances.balance = -1;
// use a SingleColorIcon for the "out of sync warning" icon
- QIcon icon = platformStyle->SingleColorIcon(":/icons/warning");
+ QIcon icon = m_platform_style->SingleColorIcon(QStringLiteral(":/icons/warning"));
ui->labelTransactionsStatus->setIcon(icon);
ui->labelWalletStatus->setIcon(icon);
@@ -257,6 +259,9 @@ void OverviewPage::setClientModel(ClientModel *model)
// Show warning, for example if this is a prerelease version
connect(model, &ClientModel::alertsChanged, this, &OverviewPage::updateAlerts);
updateAlerts(model->getStatusBarWarnings());
+
+ connect(model->getOptionsModel(), &OptionsModel::useEmbeddedMonospacedFontChanged, this, &OverviewPage::setMonospacedFont);
+ setMonospacedFont(model->getOptionsModel()->getUseEmbeddedMonospacedFont());
}
}
@@ -295,6 +300,17 @@ void OverviewPage::setWalletModel(WalletModel *model)
updateDisplayUnit();
}
+void OverviewPage::changeEvent(QEvent* e)
+{
+#ifdef Q_OS_MACOS
+ if (e->type() == QEvent::PaletteChange) {
+ QIcon icon = m_platform_style->SingleColorIcon(QStringLiteral(":/icons/warning"));
+ ui->labelTransactionsStatus->setIcon(icon);
+ ui->labelWalletStatus->setIcon(icon);
+ }
+#endif
+}
+
void OverviewPage::updateDisplayUnit()
{
if(walletModel && walletModel->getOptionsModel())
@@ -321,3 +337,17 @@ void OverviewPage::showOutOfSyncWarning(bool fShow)
ui->labelWalletStatus->setVisible(fShow);
ui->labelTransactionsStatus->setVisible(fShow);
}
+
+void OverviewPage::setMonospacedFont(bool use_embedded_font)
+{
+ QFont f = GUIUtil::fixedPitchFont(use_embedded_font);
+ f.setWeight(QFont::Bold);
+ ui->labelBalance->setFont(f);
+ ui->labelUnconfirmed->setFont(f);
+ ui->labelImmature->setFont(f);
+ ui->labelTotal->setFont(f);
+ ui->labelWatchAvailable->setFont(f);
+ ui->labelWatchPending->setFont(f);
+ ui->labelWatchImmature->setFont(f);
+ ui->labelWatchTotal->setFont(f);
+}