From b112a735d7618f0cd0280e639679d6bfaa564c23 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 16 May 2021 11:17:33 +0300 Subject: [PATCH 46/46] Improve indentation of entries in the left panel of city dialog See osdn #42298 Signed-off-by: Marko Lindqvist --- client/citydlg_common.c | 10 +++++----- client/gui-gtk-3.22/citydlg.c | 10 +++++----- client/gui-gtk-4.0/citydlg.c | 10 +++++----- client/gui-qt/citydlg.cpp | 5 +++-- 4 files changed, 18 insertions(+), 17 deletions(-) diff --git a/client/citydlg_common.c b/client/citydlg_common.c index 5143588c74..ce545d26dc 100644 --- a/client/citydlg_common.c +++ b/client/citydlg_common.c @@ -1137,7 +1137,7 @@ void get_city_dialog_airlift_value(const struct city *pcity, /* TRANS: airlift. Possible take offs text. String is a symbol that * indicates that terms and conditions apply when landings are limited * and empty when they aren't limited. */ - fc_snprintf(src, sizeof(src), _("∞%s"), + fc_snprintf(src, sizeof(src), _(" ∞%s"), game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST /* TRANS: airlift unlimited take offs may be spent symbol * used above. */ @@ -1145,7 +1145,7 @@ void get_city_dialog_airlift_value(const struct city *pcity, } else { /* TRANS: airlift. Possible take offs text. Number is * airlift capacity. */ - fc_snprintf(src, sizeof(src), _("%d"), pcity->airlift); + fc_snprintf(src, sizeof(src), _("%4d"), pcity->airlift); } if ((game.info.airlifting_style & AIRLIFTING_UNLIMITED_DEST) @@ -1154,16 +1154,16 @@ void get_city_dialog_airlift_value(const struct city *pcity, unlimited++; /* TRANS: airlift. Possible landings text. */ - fc_snprintf(dest, sizeof(dest), _("∞")); + fc_snprintf(dest, sizeof(dest), _(" ∞")); } else { /* TRANS: airlift. Possible landings text. */ - fc_snprintf(dest, sizeof(dest), _("%d"), pcity->airlift); + fc_snprintf(dest, sizeof(dest), _("%4d"), pcity->airlift); } switch (unlimited) { case 2: /* TRANS: unlimited airlift take offs and landings */ - fc_snprintf(buf, bufsz, _("∞")); + fc_snprintf(buf, bufsz, _(" ∞")); break; case 1: /* TRANS: airlift take offs and landings. One is unlimited. The first diff --git a/client/gui-gtk-3.22/citydlg.c b/client/gui-gtk-3.22/citydlg.c index 119adaabda..5f9b380a3d 100644 --- a/client/gui-gtk-3.22/citydlg.c +++ b/client/gui-gtk-3.22/citydlg.c @@ -1816,10 +1816,10 @@ static void city_dialog_update_information(GtkWidget **info_ebox, /* fill the buffers with the necessary info */ if (non_workers) { - fc_snprintf(buf[INFO_SIZE], sizeof(buf[INFO_SIZE]), "%3d (%3d)", - pcity->size, non_workers); + fc_snprintf(buf[INFO_SIZE], sizeof(buf[INFO_SIZE]), "%3d (%3d)", + pcity->size, non_workers); } else { - fc_snprintf(buf[INFO_SIZE], sizeof(buf[INFO_SIZE]), "%3d", pcity->size); + fc_snprintf(buf[INFO_SIZE], sizeof(buf[INFO_SIZE]), "%3d", pcity->size); } fc_snprintf(buf[INFO_FOOD], sizeof(buf[INFO_FOOD]), "%3d (%+4d)", pcity->prod[O_FOOD], pcity->surplus[O_FOOD]); @@ -1862,11 +1862,11 @@ static void city_dialog_update_information(GtkWidget **info_ebox, fc_snprintf(buf[INFO_POLLUTION], sizeof(buf[INFO_POLLUTION]), "%4d", pcity->pollution); if (!game.info.illness_on) { - fc_snprintf(buf[INFO_ILLNESS], sizeof(buf[INFO_ILLNESS]), " -.-"); + fc_snprintf(buf[INFO_ILLNESS], sizeof(buf[INFO_ILLNESS]), " -.-"); } else { illness = city_illness_calc(pcity, NULL, NULL, NULL, NULL); /* illness is in tenth of percent */ - fc_snprintf(buf[INFO_ILLNESS], sizeof(buf[INFO_ILLNESS]), "%4.1f%%", + fc_snprintf(buf[INFO_ILLNESS], sizeof(buf[INFO_ILLNESS]), "%5.1f%%", (float)illness / 10.0); } if (pcity->steal) { diff --git a/client/gui-gtk-4.0/citydlg.c b/client/gui-gtk-4.0/citydlg.c index e540df46f5..0ed7451a10 100644 --- a/client/gui-gtk-4.0/citydlg.c +++ b/client/gui-gtk-4.0/citydlg.c @@ -1795,10 +1795,10 @@ static void city_dialog_update_information(GtkWidget **info_label, /* fill the buffers with the necessary info */ if (non_workers) { - fc_snprintf(buf[INFO_SIZE], sizeof(buf[INFO_SIZE]), "%3d (%3d)", - pcity->size, non_workers); + fc_snprintf(buf[INFO_SIZE], sizeof(buf[INFO_SIZE]), "%3d (%3d)", + pcity->size, non_workers); } else { - fc_snprintf(buf[INFO_SIZE], sizeof(buf[INFO_SIZE]), "%3d", pcity->size); + fc_snprintf(buf[INFO_SIZE], sizeof(buf[INFO_SIZE]), "%3d", pcity->size); } fc_snprintf(buf[INFO_FOOD], sizeof(buf[INFO_FOOD]), "%3d (%+4d)", pcity->prod[O_FOOD], pcity->surplus[O_FOOD]); @@ -1841,11 +1841,11 @@ static void city_dialog_update_information(GtkWidget **info_label, fc_snprintf(buf[INFO_POLLUTION], sizeof(buf[INFO_POLLUTION]), "%4d", pcity->pollution); if (!game.info.illness_on) { - fc_snprintf(buf[INFO_ILLNESS], sizeof(buf[INFO_ILLNESS]), " -.-"); + fc_snprintf(buf[INFO_ILLNESS], sizeof(buf[INFO_ILLNESS]), " -.-"); } else { illness = city_illness_calc(pcity, NULL, NULL, NULL, NULL); /* illness is in tenth of percent */ - fc_snprintf(buf[INFO_ILLNESS], sizeof(buf[INFO_ILLNESS]), "%4.1f%%", + fc_snprintf(buf[INFO_ILLNESS], sizeof(buf[INFO_ILLNESS]), "%5.1f%%", (float)illness / 10.0); } if (pcity->steal) { diff --git a/client/gui-qt/citydlg.cpp b/client/gui-qt/citydlg.cpp index 19121d9470..b692476372 100644 --- a/client/gui-qt/citydlg.cpp +++ b/client/gui-qt/citydlg.cpp @@ -3065,12 +3065,13 @@ void city_dialog::update_info_label() dlgcity->pollution); if (!game.info.illness_on) { - fc_snprintf(buf_info[INFO_ILLNESS], sizeof(buf_info[INFO_ILLNESS]), " -.-"); + fc_snprintf(buf_info[INFO_ILLNESS], sizeof(buf_info[INFO_ILLNESS]), + " -.-"); } else { illness = city_illness_calc(dlgcity, NULL, NULL, NULL, NULL); /* illness is in tenth of percent */ fc_snprintf(buf_info[INFO_ILLNESS], sizeof(buf_info[INFO_ILLNESS]), - "%4.1f%%", (float) illness / 10.0); + "%5.1f%%", (float) illness / 10.0); } if (dlgcity->steal) { fc_snprintf(buf_info[INFO_STEAL], sizeof(buf_info[INFO_STEAL]), -- 2.30.2