diff options
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/optionsmodel.cpp | 11 | ||||
-rw-r--r-- | src/qt/optionsmodel.h | 4 | ||||
-rw-r--r-- | src/qt/overviewpage.cpp | 8 | ||||
-rw-r--r-- | src/qt/overviewpage.h | 2 |
4 files changed, 15 insertions, 10 deletions
diff --git a/src/qt/optionsmodel.cpp b/src/qt/optionsmodel.cpp index bee8fafddc..8bf1dfd9be 100644 --- a/src/qt/optionsmodel.cpp +++ b/src/qt/optionsmodel.cpp @@ -219,7 +219,7 @@ bool OptionsModel::Init(bilingual_str& error) settings.setValue("UseEmbeddedMonospacedFont", "true"); } m_use_embedded_monospaced_font = settings.value("UseEmbeddedMonospacedFont").toBool(); - Q_EMIT useEmbeddedMonospacedFontChanged(m_use_embedded_monospaced_font); + Q_EMIT fontForMoneyChanged(getFontForMoney()); m_mask_values = settings.value("mask_values", false).toBool(); @@ -454,6 +454,13 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con } } +QFont OptionsModel::getFontForMoney() const +{ + QFont f = GUIUtil::fixedPitchFont(m_use_embedded_monospaced_font); + f.setWeight(QFont::Bold); + return f; +} + bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::string& suffix) { auto changed = [&] { return value.isValid() && value != getOption(option, suffix); }; @@ -589,7 +596,7 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std:: case UseEmbeddedMonospacedFont: m_use_embedded_monospaced_font = value.toBool(); settings.setValue("UseEmbeddedMonospacedFont", m_use_embedded_monospaced_font); - Q_EMIT useEmbeddedMonospacedFontChanged(m_use_embedded_monospaced_font); + Q_EMIT fontForMoneyChanged(getFontForMoney()); break; case CoinControlFeatures: fCoinControlFeatures = value.toBool(); diff --git a/src/qt/optionsmodel.h b/src/qt/optionsmodel.h index f28a1087ba..63abfb11fe 100644 --- a/src/qt/optionsmodel.h +++ b/src/qt/optionsmodel.h @@ -93,7 +93,7 @@ public: bool getMinimizeOnClose() const { return fMinimizeOnClose; } BitcoinUnit getDisplayUnit() const { return m_display_bitcoin_unit; } QString getThirdPartyTxUrls() const { return strThirdPartyTxUrls; } - bool getUseEmbeddedMonospacedFont() const { return m_use_embedded_monospaced_font; } + QFont getFontForMoney() const; bool getCoinControlFeatures() const { return fCoinControlFeatures; } bool getSubFeeFromAmount() const { return m_sub_fee_from_amount; } bool getEnablePSBTControls() const { return m_enable_psbt_controls; } @@ -139,7 +139,7 @@ Q_SIGNALS: void displayUnitChanged(BitcoinUnit unit); void coinControlFeaturesChanged(bool); void showTrayIconChanged(bool); - void useEmbeddedMonospacedFontChanged(bool); + void fontForMoneyChanged(const QFont&); }; #endif // BITCOIN_QT_OPTIONSMODEL_H diff --git a/src/qt/overviewpage.cpp b/src/qt/overviewpage.cpp index 0f00d167f7..7d58492082 100644 --- a/src/qt/overviewpage.cpp +++ b/src/qt/overviewpage.cpp @@ -250,8 +250,8 @@ void OverviewPage::setClientModel(ClientModel *model) connect(model, &ClientModel::alertsChanged, this, &OverviewPage::updateAlerts); updateAlerts(model->getStatusBarWarnings()); - connect(model->getOptionsModel(), &OptionsModel::useEmbeddedMonospacedFontChanged, this, &OverviewPage::setMonospacedFont); - setMonospacedFont(model->getOptionsModel()->getUseEmbeddedMonospacedFont()); + connect(model->getOptionsModel(), &OptionsModel::fontForMoneyChanged, this, &OverviewPage::setMonospacedFont); + setMonospacedFont(clientModel->getOptionsModel()->getFontForMoney()); } } @@ -340,10 +340,8 @@ void OverviewPage::showOutOfSyncWarning(bool fShow) ui->labelTransactionsStatus->setVisible(fShow); } -void OverviewPage::setMonospacedFont(bool use_embedded_font) +void OverviewPage::setMonospacedFont(const QFont& f) { - QFont f = GUIUtil::fixedPitchFont(use_embedded_font); - f.setWeight(QFont::Bold); ui->labelBalance->setFont(f); ui->labelUnconfirmed->setFont(f); ui->labelImmature->setFont(f); diff --git a/src/qt/overviewpage.h b/src/qt/overviewpage.h index 5c487ee116..fc7a99f319 100644 --- a/src/qt/overviewpage.h +++ b/src/qt/overviewpage.h @@ -65,7 +65,7 @@ private Q_SLOTS: void handleTransactionClicked(const QModelIndex &index); void updateAlerts(const QString &warnings); void updateWatchOnlyLabels(bool showWatchOnly); - void setMonospacedFont(bool use_embedded_font); + void setMonospacedFont(const QFont&); }; #endif // BITCOIN_QT_OVERVIEWPAGE_H |