Fix initialization issue with user modified application font

The main  window font  has to  be set  after main  window construction
otherwise the menu bar font does not get set.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8077 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville
2017-09-09 19:34:54 +00:00
parent 4d5331899b
commit c8dc00320f
4 changed files with 34 additions and 21 deletions
+3 -17
View File
@@ -380,8 +380,6 @@ private:
bool load_audio_devices (QAudio::Mode, QComboBox *, QAudioDeviceInfo *);
void update_audio_channels (QComboBox const *, int, QComboBox *, bool);
void set_application_font (QFont const&);
void initialize_models ();
bool split_mode () const
{
@@ -621,6 +619,7 @@ QColor Configuration::color_MyCall () const {return m_->color_MyCall_;}
QColor Configuration::color_TxMsg () const {return m_->color_TxMsg_;}
QColor Configuration::color_DXCC () const {return m_->color_DXCC_;}
QColor Configuration::color_NewCall () const {return m_->color_NewCall_;}
QFont Configuration::text_font () const {return m_->font_;}
QFont Configuration::decoded_text_font () const {return m_->decoded_text_font_;}
qint32 Configuration::id_interval () const {return m_->id_interval_;}
qint32 Configuration::ntrials() const {return m_->ntrials_;}
@@ -1179,13 +1178,12 @@ void Configuration::impl::read_settings ()
&& next_font_ != font_)
{
font_ = next_font_;
Q_EMIT self_->text_font_changed (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_)
{
@@ -1694,7 +1692,7 @@ void Configuration::impl::accept ()
if (next_font_ != font_)
{
font_ = next_font_;
set_application_font (font_);
Q_EMIT self_->text_font_changed (font_);
}
if (next_decoded_text_font_ != decoded_text_font_)
@@ -2633,18 +2631,6 @@ 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 ())
{
widget->updateGeometry ();
}
}
// load all the supported rig names into the selection combo box
void Configuration::impl::enumerate_rigs ()
{