diff --git a/client/gui-qt/citydlg.cpp b/client/gui-qt/citydlg.cpp index 47339160fc..7147eac013 100644 --- a/client/gui-qt/citydlg.cpp +++ b/client/gui-qt/citydlg.cpp @@ -65,6 +65,7 @@ #include "citydlg.h" #include "colors.h" #include "fc_client.h" +#include "gui_main.h" #include "hudwidget.h" extern QApplication *qapp; @@ -85,6 +86,7 @@ progress_bar::progress_bar(QWidget *parent): QProgressBar(parent) startTimer(50); create_region(); sfont = new QFont; + log_qtfont(sfont, "Drawing font for progress bar"); m_animate_step = 0; pix = nullptr; } @@ -255,6 +257,7 @@ void progress_bar::paintEvent(QPaintEvent *event) p.setPen(c); sfont->setCapitalization(QFont::AllUppercase); sfont->setBold(true); + log_qtfont(sfont, "Progress bar painter") p.setFont(*sfont); if (text().contains('\n')) { @@ -271,6 +274,8 @@ void progress_bar::paintEvent(QPaintEvent *event) } else { sfont->setPointSize(height() / 4); } + + log_qtfont(sfont, "Painter adjusted") } j = height() - 2 * f_size; @@ -3258,6 +3263,9 @@ void city_dialog::update_building() str = QString(buf); str = str.simplified(); + QFont tmp = production_combo_p->font(); + log_qtfont(&tmp, "Production combo itself"); + log_qtfont(production_combo_p->sfont, "Production combo uses"); production_combo_p->setFormat(QString("(%p%) %2\n%1") .arg(city_production_name_translation(pcity), str)); diff --git a/client/gui-qt/citydlg.h b/client/gui-qt/citydlg.h index 70095de441..c93fbbd845 100644 --- a/client/gui-qt/citydlg.h +++ b/client/gui-qt/citydlg.h @@ -122,6 +122,7 @@ public: void set_pixmap(struct universal *target); void set_pixmap(int n); + QFont *sfont; protected: void paintEvent(QPaintEvent *event); void timerEvent(QTimerEvent *event); @@ -131,7 +132,6 @@ private: int m_animate_step; QPixmap *pix; QRegion reg; - QFont *sfont; }; /**************************************************************************** diff --git a/client/gui-qt/gui_main.cpp b/client/gui-qt/gui_main.cpp index c150a363ef..8cc2c2a668 100644 --- a/client/gui-qt/gui_main.cpp +++ b/client/gui-qt/gui_main.cpp @@ -199,6 +199,9 @@ void qtg_ui_main(int argc, char *argv[]) } } options_iterate_end; + QFont tmp = QApplication::font(); + log_qtfont(&tmp, "App default after change callbacks"); + freeciv_qt->fc_main(qapp); } } @@ -416,6 +419,7 @@ static void apply_font(struct option *poption) remove_old = fc_font::instance()->get_font(s); delete remove_old; fc_font::instance()->set_font(s, f); + log_qtfont(f, s.toUtf8().data()); update_city_descriptions(); gui()->infotab->chtwdg->update_font(); QApplication::setFont(*fc_font::instance()->get_font(fonts::default_font)); diff --git a/client/gui-qt/gui_main.h b/client/gui-qt/gui_main.h index fe721e545a..7aec87723c 100644 --- a/client/gui-qt/gui_main.h +++ b/client/gui-qt/gui_main.h @@ -17,4 +17,7 @@ void popup_quit_dialog(); QApplication *current_app(); +#define log_qtfont(__font__, __msg__) log_normal("%s : %s.", (__msg__), \ + (__font__)->toString().toUtf8().data()) + #endif /* FC__GUI_MAIN_H */