diff --git a/Configuration.cpp b/Configuration.cpp index 616db6725..4c053fa0d 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -1141,12 +1141,12 @@ void Configuration::impl::read_settings () && next_font_ != font_) { font_ = next_font_; - set_application_font (font_); } else { next_font_ = font_; } + set_application_font (font_); if (next_decoded_text_font_.fromString (settings_->value ("DecodedTextFont", "Courier, 10").toString ()) && next_decoded_text_font_ != decoded_text_font_) @@ -2511,6 +2511,9 @@ void Configuration::impl::update_audio_channels (QComboBox const * source_combo_ void Configuration::impl::set_application_font (QFont const& font) { + qApp->setFont (font); + // set font in the application style sheet as well in case it has + // been modified in the style sheet which has priority qApp->setStyleSheet (qApp->styleSheet () + "* {" + font_as_stylesheet (font) + '}'); for (auto& widget : qApp->topLevelWidgets ()) { diff --git a/MultiSettings.cpp b/MultiSettings.cpp index 698fcc8b8..17bb620f0 100644 --- a/MultiSettings.cpp +++ b/MultiSettings.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -28,6 +29,7 @@ #include #include "SettingsGroup.hpp" +#include "qt_helpers.hpp" #include "pimpl_impl.hpp" @@ -180,6 +182,7 @@ private: // remove a configuration void delete_configuration (QMainWindow *); + QFont original_font_; QString current_; // action to take on restart @@ -307,6 +310,15 @@ bool MultiSettings::impl::reposition () } // insert the new settings load_from (new_settings_, false); + if (!new_settings_.size ()) + { + // if we are clearing the current settings then we must + // reset the application font and the font in the + // application style sheet, this is necessary since the + // application instance is not recreated + qApp->setFont (original_font_); + qApp->setStyleSheet (qApp->styleSheet () + "* {" + font_as_stylesheet (original_font_) + '}'); + } // now we have set up the new current we can safely purge it // from the alternatives { @@ -422,8 +434,10 @@ auto MultiSettings::impl::get_settings () const -> Dictionary Dictionary settings; for (auto const& key: settings_.allKeys ()) { - // filter out multi settings group - if (!key.contains (multi_settings_root_group)) + // filter out multi settings group and empty settings + // placeholder + if (!key.contains (multi_settings_root_group) + && !key.contains (multi_settings_place_holder_key)) { settings[key] = settings_.value (key); }