From c14ae58f4f44e35b819e84d90314a81a0986b8b7 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 24 Apr 2022 13:43:17 +0300 Subject: [PATCH 50/50] 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 82578c531d..b7133f066e 100644 --- a/client/gui-qt/citydlg.cpp +++ b/client/gui-qt/citydlg.cpp @@ -3001,6 +3001,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'; @@ -3008,8 +3009,12 @@ void city_dialog::update_info_label() } /* fill the buffers with the necessary info */ + spec = city_specialists(dlgcity); fc_snprintf(buf_info[INFO_CITIZEN], sizeof(buf_info[INFO_CITIZEN]), - "%3d (%4d)", dlgcity->size, city_specialists(dlgcity)); + "%3d (%4d)", dlgcity->size, spec); + fc_snprintf(buf_tooltip[INFO_CITIZEN], sizeof(buf_tooltip[INFO_CITIZEN]), + _("Population: %d, Specialists: %d"), + dlgcity->size, spec); fc_snprintf(buf_info[INFO_FOOD], sizeof(buf_info[INFO_FOOD]), "%3d (%+4d)", dlgcity->prod[O_FOOD], dlgcity->surplus[O_FOOD]); fc_snprintf(buf_info[INFO_SHIELD], sizeof(buf_info[INFO_SHIELD]), -- 2.35.1