From 3af565edf99bcb484d400140461c5d285913ced5 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Wed, 25 May 2022 22:01:11 +0300 Subject: [PATCH 16/16] Gtk: Add tooltip for citydlg "Size" line See osdn #44515 Signed-off-by: Marko Lindqvist --- client/gui-gtk-3.0/citydlg.c | 6 +++++- client/gui-gtk-3.22/citydlg.c | 6 +++++- client/gui-gtk-4.0/citydlg.c | 4 ++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/client/gui-gtk-3.0/citydlg.c b/client/gui-gtk-3.0/citydlg.c index b45928e11e..37ec7a2b3b 100644 --- a/client/gui-gtk-3.0/citydlg.c +++ b/client/gui-gtk-3.0/citydlg.c @@ -658,8 +658,12 @@ static gboolean show_info_popup(GtkWidget *w, GdkEventButton *ev, if (ev->button == 1) { GtkWidget *p, *label, *frame; char buf[1024]; - + switch (GPOINTER_TO_UINT(data)) { + case INFO_SIZE: + fc_snprintf(buf, sizeof(buf), _("Population: %d, Specialists: %d"), + pdialog->pcity->size, city_specialists(pdialog->pcity)); + break; case INFO_FOOD: get_city_dialog_output_text(pdialog->pcity, O_FOOD, buf, sizeof(buf)); break; diff --git a/client/gui-gtk-3.22/citydlg.c b/client/gui-gtk-3.22/citydlg.c index 8d16fc570f..444be45a85 100644 --- a/client/gui-gtk-3.22/citydlg.c +++ b/client/gui-gtk-3.22/citydlg.c @@ -658,8 +658,12 @@ static gboolean show_info_popup(GtkWidget *w, GdkEventButton *ev, if (ev->button == 1) { GtkWidget *p, *label, *frame; char buf[1024]; - + switch (GPOINTER_TO_UINT(data)) { + case INFO_SIZE: + fc_snprintf(buf, sizeof(buf), _("Population: %d, Specialists: %d"), + pdialog->pcity->size, city_specialists(pdialog->pcity)); + break; case INFO_FOOD: get_city_dialog_output_text(pdialog->pcity, O_FOOD, buf, sizeof(buf)); break; diff --git a/client/gui-gtk-4.0/citydlg.c b/client/gui-gtk-4.0/citydlg.c index 54ed523261..2e615e460c 100644 --- a/client/gui-gtk-4.0/citydlg.c +++ b/client/gui-gtk-4.0/citydlg.c @@ -643,6 +643,10 @@ static gboolean show_info_popup(GtkWidget *w, GdkEvent *ev, char buf[1024]; switch (GPOINTER_TO_UINT(data)) { + case INFO_SIZE: + fc_snprintf(buf, sizeof(buf), _("Population: %d, Specialists: %d"), + pdialog->pcity->size, city_specialists(pdialog->pcity)); + break; case INFO_FOOD: get_city_dialog_output_text(pdialog->pcity, O_FOOD, buf, sizeof(buf)); break; -- 2.35.1