From 7d43d4d23e74253d26de4beac33925659dd031b1 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 24 Apr 2022 13:47:16 +0300 Subject: [PATCH 26/26] Qt: Add tooltip for citydlg "Size" line Requested by ddeanbrown See osdn #44409 Signed-off-by: Marko Lindqvist --- client/gui-qt/citydlg.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/client/gui-qt/citydlg.cpp b/client/gui-qt/citydlg.cpp index 7e7e012943..b4977614cf 100644 --- a/client/gui-qt/citydlg.cpp +++ b/client/gui-qt/citydlg.cpp @@ -2963,6 +2963,7 @@ void city_dialog::update_info_label() char buf_info[NUM_INFO_FIELDS][512]; char buf_tooltip[NUM_INFO_FIELDS][512]; int granaryturns; + int spec; for (int i = 0; i < NUM_INFO_FIELDS; i++) { buf_info[i][0] = '\0'; @@ -2970,8 +2971,12 @@ void city_dialog::update_info_label() } /* fill the buffers with the necessary info */ + spec = city_specialists(pcity); fc_snprintf(buf_info[INFO_CITIZEN], sizeof(buf_info[INFO_CITIZEN]), - "%3d (%4d)", pcity->size, city_specialists(pcity)); + "%3d (%4d)", pcity->size, spec); + fc_snprintf(buf_tooltip[INFO_CITIZEN], sizeof(buf_tooltip[INFO_CITIZEN]), + _("Population: %d, Specialists: %d"), + pcity->size, spec); fc_snprintf(buf_info[INFO_FOOD], sizeof(buf_info[INFO_FOOD]), "%3d (%+4d)", pcity->prod[O_FOOD], pcity->surplus[O_FOOD]); fc_snprintf(buf_info[INFO_SHIELD], sizeof(buf_info[INFO_SHIELD]), -- 2.35.1