@@ -218,7 +218,11 @@ bool OptionsModel::Init(bilingual_str& error)
218
218
if (!settings.contains (" UseEmbeddedMonospacedFont" )) {
219
219
settings.setValue (" UseEmbeddedMonospacedFont" , " true" );
220
220
}
221
- m_use_embedded_monospaced_font = settings.value (" UseEmbeddedMonospacedFont" ).toBool ();
221
+ if (settings.value (" UseEmbeddedMonospacedFont" ).toBool ()) {
222
+ m_font_money = FontChoiceAbstract::EmbeddedFont;
223
+ } else {
224
+ m_font_money = FontChoiceAbstract::BestSystemFont;
225
+ }
222
226
Q_EMIT fontForMoneyChanged (getFontForMoney ());
223
227
224
228
m_mask_values = settings.value (" mask_values" , false ).toBool ();
@@ -428,7 +432,7 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
428
432
case Language:
429
433
return QString::fromStdString (SettingToString (setting (), " " ));
430
434
case UseEmbeddedMonospacedFont:
431
- return m_use_embedded_monospaced_font ;
435
+ return (m_font_money != UseBestSystemFont) ;
432
436
case CoinControlFeatures:
433
437
return fCoinControlFeatures ;
434
438
case EnablePSBTControls:
@@ -456,8 +460,13 @@ QVariant OptionsModel::getOption(OptionID option, const std::string& suffix) con
456
460
457
461
QFont OptionsModel::getFontForMoney () const
458
462
{
459
- QFont f = GUIUtil::fixedPitchFont (m_use_embedded_monospaced_font);
460
- f.setWeight (QFont::Bold);
463
+ QFont f;
464
+ if (std::holds_alternative<FontChoiceAbstract>(m_font_money)) {
465
+ f = GUIUtil::fixedPitchFont (m_font_money != UseBestSystemFont);
466
+ f.setWeight (QFont::Bold);
467
+ } else {
468
+ f = std::get<QFont>(m_font_money);
469
+ }
461
470
return f;
462
471
}
463
472
@@ -594,10 +603,21 @@ bool OptionsModel::setOption(OptionID option, const QVariant& value, const std::
594
603
}
595
604
break ;
596
605
case UseEmbeddedMonospacedFont:
597
- m_use_embedded_monospaced_font = value.toBool ();
598
- settings.setValue (" UseEmbeddedMonospacedFont" , m_use_embedded_monospaced_font);
606
+ {
607
+ const bool use_embedded_monospaced_font = value.toBool ();
608
+ if (use_embedded_monospaced_font) {
609
+ if (m_font_money != UseBestSystemFont) {
610
+ // Leave it as-is
611
+ break ;
612
+ }
613
+ m_font_money = FontChoiceAbstract::EmbeddedFont;
614
+ } else {
615
+ m_font_money = FontChoiceAbstract::BestSystemFont;
616
+ }
617
+ settings.setValue (" UseEmbeddedMonospacedFont" , use_embedded_monospaced_font);
599
618
Q_EMIT fontForMoneyChanged (getFontForMoney ());
600
619
break ;
620
+ }
601
621
case CoinControlFeatures:
602
622
fCoinControlFeatures = value.toBool ();
603
623
settings.setValue (" fCoinControlFeatures" , fCoinControlFeatures );
0 commit comments