From 8b0d8e00b8635ebaab032f51a316f3ae2762eb1d Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 28 May 2023 19:54:49 +0300 Subject: [PATCH 30/30] sdl2: Make size 12 fonts to adjust to theme font size See osdn #48100 Signed-off-by: Marko Lindqvist --- client/gui-sdl2/action_dialog.c | 51 +++++---- client/gui-sdl2/chatline.c | 94 +++++++++------- client/gui-sdl2/citydlg.c | 119 +++++++++++--------- client/gui-sdl2/cityrep.c | 27 ++--- client/gui-sdl2/cma_fe.c | 75 +++++++------ client/gui-sdl2/connectdlg.c | 18 +-- client/gui-sdl2/dialogs.c | 143 +++++++++++++----------- client/gui-sdl2/diplodlg.c | 188 ++++++++++++++++++-------------- client/gui-sdl2/finddlg.c | 8 +- client/gui-sdl2/gotodlg.c | 21 ++-- client/gui-sdl2/gui_string.c | 5 + client/gui-sdl2/gui_string.h | 3 +- client/gui-sdl2/helpdlg.c | 160 +++++++++++++++------------ client/gui-sdl2/inteldlg.c | 18 +-- client/gui-sdl2/mapctrl.c | 66 +++++------ client/gui-sdl2/mapview.c | 5 +- client/gui-sdl2/messagewin.c | 4 +- client/gui-sdl2/optiondlg.c | 157 ++++++++++++++------------ client/gui-sdl2/pages.c | 10 +- client/gui-sdl2/plrdlg.c | 17 +-- client/gui-sdl2/repodlgs.c | 106 +++++++++--------- client/gui-sdl2/spaceshipdlg.c | 17 +-- client/gui-sdl2/widget_button.h | 31 ++++-- client/gui-sdl2/widget_combo.h | 16 ++- client/gui-sdl2/wldlg.c | 6 +- 25 files changed, 757 insertions(+), 608 deletions(-) diff --git a/client/gui-sdl2/action_dialog.c b/client/gui-sdl2/action_dialog.c index 91597dc3d9..7281afcb5e 100644 --- a/client/gui-sdl2/action_dialog.c +++ b/client/gui-sdl2/action_dialog.c @@ -394,7 +394,8 @@ static int spy_steal_popup_shared(struct widget *pwidget) diplomat_dlg->target_ids[ATK_CITY] = vcity->id; diplomat_dlg->pdialog = fc_calloc(1, sizeof(struct advanced_dialog)); - pstr = create_utf8_from_char(_("Select Advance to Steal"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Select Advance to Steal"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -409,11 +410,11 @@ static int spy_steal_popup_shared(struct widget *pwidget) area.w = MAX(area.w, adj_size(8)); /* ------------------ */ - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += buf->size.w + adj_size(10); buf->action = exit_spy_tgt_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -970,10 +971,11 @@ void popup_action_selection(struct unit *actor_unit, /* TRANS: %s is a unit name, e.g., Spy */ astr_set(&title, _("Choose Your %s's Strategy"), unit_name_translation(actor_unit)); - pstr = create_utf8_from_char(astr_str(&title), adj_font(12)); + pstr = create_utf8_from_char_fonto(astr_str(&title), FONTO_ATTENTION); astr_free(&title); } else { - pstr = create_utf8_from_char(_("Subvert Enemy Unit"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Subvert Enemy Unit"), + FONTO_ATTENTION); } pstr->style |= TTF_STYLE_BOLD; @@ -1328,10 +1330,11 @@ void popup_sabotage_dialog(struct unit *actor, struct city *pcity, cont = fc_calloc(1, sizeof(struct container)); cont->id0 = pcity->id; - cont->id1 = actor->id; /* spy id */ + cont->id1 = actor->id; /* Spy id */ cont->value = paction->id; - pstr = create_utf8_from_char(_("Select Improvement to Sabotage") , adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Select Improvement to Sabotage"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -1346,11 +1349,11 @@ void popup_sabotage_dialog(struct unit *actor, struct city *pcity, area.h = MAX(area.h, adj_size(2)); /* ---------- */ - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += buf->size.w + adj_size(10); buf->action = exit_spy_tgt_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1639,8 +1642,8 @@ void popup_incite_dialog(struct unit *actor, struct city *pcity, int cost, client_player()->economic.gold), client_player()->economic.gold); - /* window */ - pstr = create_utf8_from_char(_("Incite a Revolt!"), adj_font(12)); + /* Window */ + pstr = create_utf8_from_char_fonto(_("Incite a Revolt!"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; @@ -1657,12 +1660,12 @@ void popup_incite_dialog(struct unit *actor, struct city *pcity, int cost, area.h = MAX(area.h, adj_size(2)); if (INCITE_IMPOSSIBLE_COST == cost) { - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += buf->size.w + adj_size(10); buf->action = exit_incite_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1727,12 +1730,12 @@ void popup_incite_dialog(struct unit *actor, struct city *pcity, int cost, area.h += buf->size.h; } else { - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += buf->size.w + adj_size(10); buf->action = exit_incite_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1902,8 +1905,8 @@ void popup_bribe_dialog(struct unit *actor, struct unit *punit, int cost, client_player()->economic.gold), client_player()->economic.gold); - /* window */ - pstr = create_utf8_from_char(_("Bribe Enemy Unit"), adj_font(12)); + /* Window */ + pstr = create_utf8_from_char_fonto(_("Bribe Enemy Unit"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; @@ -1955,12 +1958,12 @@ void popup_bribe_dialog(struct unit *actor, struct unit *punit, int cost, area.h += buf->size.h; } else { - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += buf->size.w + adj_size(10); buf->action = exit_bribe_dlg_callback; set_wstate(buf, FC_WS_NORMAL); diff --git a/client/gui-sdl2/chatline.c b/client/gui-sdl2/chatline.c index 655b062790..eb4bab0d5d 100644 --- a/client/gui-sdl2/chatline.c +++ b/client/gui-sdl2/chatline.c @@ -197,10 +197,11 @@ static void popup_load_game_dialog(void) widget_redraw(conn_dlg->start_button); widget_mark_dirty(conn_dlg->start_button); - /* create dialog */ + /* Create dialog */ load_dialog = fc_calloc(1, sizeof(struct advanced_dialog)); - title = create_utf8_from_char(_("Choose Saved Game to Load"), adj_font(12)); + title = create_utf8_from_char_fonto(_("Choose Saved Game to Load"), + FONTO_ATTENTION); title->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, title, 0); @@ -213,12 +214,13 @@ static void popup_load_game_dialog(void) area = pwindow->area; - /* close button */ - close_button = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, + /* Close button */ + close_button = create_themeicon(current_theme->small_cancel_icon, + pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - close_button->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + close_button->info_label + = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), FONTO_ATTENTION); close_button->action = exit_load_dlg_callback; set_wstate(close_button, FC_WS_NORMAL); close_button->key = SDLK_ESCAPE; @@ -229,11 +231,11 @@ static void popup_load_game_dialog(void) load_dialog->begin_widget_list = close_button; - /* create scrollbar */ + /* Create scrollbar */ scrollbar_width = create_vertical_scrollbar(load_dialog, 1, 20, TRUE, TRUE); hide_scrollbar(load_dialog->scroll); - /* search for user saved games. */ + /* Search for user saved games. */ files = fileinfolist_infix(get_save_dirs(), ".sav", FALSE); fileinfo_list_iterate(files, pfile) { count++; @@ -357,8 +359,9 @@ void popup_input_line(void) { struct widget *input_edit; - input_edit = create_edit_from_chars(NULL, main_data.gui, "", adj_font(12), - adj_size(400), 0); + input_edit = create_edit_from_chars_fonto(NULL, main_data.gui, "", + FONTO_ATTENTION, + adj_size(400), 0); input_edit->size.x = (main_window_width() - input_edit->size.w) / 2; input_edit->size.y = (main_window_height() - input_edit->size.h) / 2; @@ -375,7 +378,7 @@ void popup_input_line(void) } /**********************************************************************//** - Appends the string to the chat output window. The string should be + Appends the string to the chat output window. The string should be inserted on its own line, although it will have no newline. **************************************************************************/ void real_output_window_append(const char *astring, @@ -446,16 +449,18 @@ static void add_to_chat_list(char *msg, size_t n_alloc) fc_assert_ret(msg != NULL); fc_assert_ret(n_alloc != 0); - pstr = create_utf8_str(msg, n_alloc, adj_font(12)); + pstr = create_utf8_str_fonto(msg, n_alloc, FONTO_ATTENTION); - if (convert_utf8_str_to_const_surface_width(pstr, conn_dlg->text_width - adj_size(5))) { + if (convert_utf8_str_to_const_surface_width(pstr, + conn_dlg->text_width - adj_size(5))) { utf8_str *pstr2; int count = 0; char **utf8_texts = create_new_line_utf8strs(pstr->text); while (utf8_texts[count] != NULL) { - pstr2 = create_utf8_str(utf8_texts[count], - strlen(utf8_texts[count]) + 1, adj_font(12)); + pstr2 = create_utf8_str_fonto(utf8_texts[count], + strlen(utf8_texts[count]) + 1, + FONTO_ATTENTION); pstr2->bgcol = (SDL_Color) {0, 0, 0, 0}; buf = create_themelabel2(NULL, pwindow->dst, pstr2, conn_dlg->text_width, 0, @@ -571,7 +576,7 @@ void real_conn_list_dialog_update(void *unused) if (C_S_PREPARING == client_state()) { if (conn_dlg) { struct widget *buf = NULL, *pwindow = conn_dlg->end_widget_list; - utf8_str *pstr = create_utf8_str(NULL, 0, adj_font(12)); + utf8_str *pstr = create_utf8_str_fonto(NULL, 0, FONTO_ATTENTION); bool create; pstr->bgcol = (SDL_Color) {0, 0, 0, 0}; @@ -667,7 +672,7 @@ static void popup_conn_list_dialog(void) struct widget* back_button = NULL; struct widget *start_game_button = NULL; struct widget *select_nation_button = NULL; -/* struct widget *server_settings_button = NULL;*/ +/* struct widget *server_settings_button = NULL; */ utf8_str *pstr = NULL; int n; SDL_Rect area; @@ -691,16 +696,17 @@ static void popup_conn_list_dialog(void) widget_set_position(pwindow, 0, 0); - /* create window background */ + /* Create window background */ surf = theme_get_background(active_theme, BACKGROUND_CONNLISTDLG); if (resize_window(pwindow, surf, NULL, main_window_width(), main_window_height())) { FREESURFACE(surf); } - conn_dlg->text_width = pwindow->size.w - adj_size(130) - adj_size(20) - adj_size(20); + conn_dlg->text_width + = pwindow->size.w - adj_size(130) - adj_size(20) - adj_size(20); - /* chat area background */ + /* Chat area background */ area.x = adj_size(10); area.y = adj_size(14); area.w = conn_dlg->text_width + adj_size(20); @@ -711,7 +717,7 @@ static void popup_conn_list_dialog(void) area.x - 1, area.y - 1, area.w + 1, area.h + 1, get_theme_color(COLOR_THEME_CONNLISTDLG_FRAME)); - /* user list background */ + /* User list background */ area.x = pwindow->size.w - adj_size(130); area.y = adj_size(14); area.w = adj_size(120); @@ -726,7 +732,7 @@ static void popup_conn_list_dialog(void) /* -------------------------------- */ - /* chat area */ + /* Chat area */ conn_dlg->chat_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); @@ -736,7 +742,7 @@ static void popup_conn_list_dialog(void) char cbuf[256]; fc_snprintf(cbuf, sizeof(cbuf), _("Total users logged in : %d"), n); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); } pstr->bgcol = (SDL_Color) {0, 0, 0, 0}; @@ -769,9 +775,10 @@ static void popup_conn_list_dialog(void) /* Input field */ - buf = create_edit_from_chars(NULL, pwindow->dst, "", - adj_font(12), pwindow->size.w - adj_size(10) - adj_size(10), - (WF_RESTORE_BACKGROUND|WF_EDIT_LOOP)); + buf = create_edit_from_chars_fonto(NULL, pwindow->dst, "", + FONTO_ATTENTION, + pwindow->size.w - adj_size(10) - adj_size(10), + (WF_RESTORE_BACKGROUND|WF_EDIT_LOOP)); buf->size.x = adj_size(10); buf->size.y = pwindow->size.h - adj_size(40) - adj_size(5) - buf->size.h; @@ -782,8 +789,9 @@ static void popup_conn_list_dialog(void) /* Buttons */ - buf = create_themeicon_button_from_chars(current_theme->back_icon, pwindow->dst, - _("Back"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->back_icon, + pwindow->dst, + _("Back"), FONTO_ATTENTION, 0); buf->size.x = adj_size(10); buf->size.y = pwindow->size.h - adj_size(10) - buf->size.h; conn_dlg->back_button = buf; @@ -793,8 +801,10 @@ static void popup_conn_list_dialog(void) add_to_gui_list(ID_BUTTON, buf); back_button = buf; - buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst, - _("Start"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->ok_icon, + pwindow->dst, + _("Start"), + FONTO_ATTENTION, 0); buf->size.x = pwindow->size.w - adj_size(10) - buf->size.w; buf->size.y = back_button->size.y; conn_dlg->start_button = buf; @@ -803,8 +813,9 @@ static void popup_conn_list_dialog(void) add_to_gui_list(ID_BUTTON, buf); start_game_button = buf; - buf = create_themeicon_button_from_chars(NULL, pwindow->dst, - _("Pick Nation"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(NULL, pwindow->dst, + _("Pick Nation"), + FONTO_ATTENTION, 0); buf->size.h = start_game_button->size.h; buf->size.x = start_game_button->size.x - adj_size(10) - buf->size.w; buf->size.y = start_game_button->size.y; @@ -814,8 +825,9 @@ static void popup_conn_list_dialog(void) add_to_gui_list(ID_BUTTON, buf); select_nation_button = buf; - buf = create_themeicon_button_from_chars(NULL, pwindow->dst, - _("Load Game"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(NULL, pwindow->dst, + _("Load Game"), + FONTO_ATTENTION, 0); buf->size.h = select_nation_button->size.h; buf->size.x = select_nation_button->size.x - adj_size(10) - buf->size.w; buf->size.y = select_nation_button->size.y; @@ -824,11 +836,11 @@ static void popup_conn_list_dialog(void) set_wstate(buf, FC_WS_NORMAL); add_to_gui_list(ID_BUTTON, buf); - /* not implemented yet */ + /* Not implemented yet */ #if 0 - buf = create_themeicon_button_from_chars(NULL, pwindow->dst, - _("Server Settings"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(NULL, pwindow->dst, + _("Server Settings"), + FONTO_ATTENTION, 0); buf->size.h = select_nation_button->size.h; buf->size.x = select_nation_button->size.x - adj_size(10) - buf->size.w; buf->size.y = select_nation_button->size.y; @@ -839,10 +851,10 @@ static void popup_conn_list_dialog(void) server_settings_button = buf; #endif /* 0 */ - /* not implemented yet */ + /* Not implemented yet */ #if 0 - buf = create_themeicon_button_from_chars(NULL, pwindow->dst->surface, - "?", adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(NULL, pwindow->dst->surface, + "?", FONTO_ATTENTION, 0); buf->size.y = pwindow->size.y + pwindow->size.h - (buf->size.h + 7); buf->size.x = pwindow->size.x + pwindow->size.w - (buf->size.w + 10) - 5; diff --git a/client/gui-sdl2/citydlg.c b/client/gui-sdl2/citydlg.c index ac3f4ab35a..0ec3f5670f 100644 --- a/client/gui-sdl2/citydlg.c +++ b/client/gui-sdl2/citydlg.c @@ -419,7 +419,7 @@ static int units_orders_city_dlg_callback(struct widget *button) /* Window */ fc_snprintf(cbuf, sizeof(cbuf), "%s:", _("Unit commands")); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -432,7 +432,7 @@ static int units_orders_city_dlg_callback(struct widget *button) /* Unit description */ fc_snprintf(cbuf, sizeof(cbuf), "%s", unit_description(punit)); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= (TTF_STYLE_BOLD|SF_CENTER); buf = create_iconlabel(adj_surf(get_unittype_surface(putype, punit->facing)), pwindow->dst, pstr, WF_FREE_THEME); @@ -440,8 +440,9 @@ static int units_orders_city_dlg_callback(struct widget *button) add_to_gui_list(ID_LABEL, buf); /* Activate unit */ - buf = create_icon_button_from_chars(NULL, pwindow->dst, - _("Activate unit"), adj_font(12), 0); + buf = create_icon_button_from_chars_fonto(NULL, pwindow->dst, + _("Activate unit"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, buf->size.w); hh = MAX(hh, buf->size.h); @@ -451,9 +452,9 @@ static int units_orders_city_dlg_callback(struct widget *button) add_to_gui_list(button->id, buf); /* Activate unit, close dlg. */ - buf = create_icon_button_from_chars(NULL, pwindow->dst, - _("Activate unit, close dialog"), - adj_font(12), 0); + buf = create_icon_button_from_chars_fonto(NULL, pwindow->dst, + _("Activate unit, close dialog"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, buf->size.w); hh = MAX(hh, buf->size.h); @@ -465,8 +466,9 @@ static int units_orders_city_dlg_callback(struct widget *button) if (pcity_dlg->page == ARMY_PAGE) { /* Sentry unit */ - buf = create_icon_button_from_chars(NULL, pwindow->dst, - _("Sentry unit"), adj_font(12), 0); + buf = create_icon_button_from_chars_fonto(NULL, pwindow->dst, + _("Sentry unit"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, buf->size.w); hh = MAX(hh, buf->size.h); @@ -480,8 +482,9 @@ static int units_orders_city_dlg_callback(struct widget *button) /* ----- */ /* Fortify unit */ - buf = create_icon_button_from_chars(NULL, pwindow->dst, - _("Fortify unit"), adj_font(12), 0); + buf = create_icon_button_from_chars_fonto(NULL, pwindow->dst, + _("Fortify unit"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, buf->size.w); hh = MAX(hh, buf->size.h); @@ -496,8 +499,9 @@ static int units_orders_city_dlg_callback(struct widget *button) /* ----- */ /* Disband unit */ - buf = create_icon_button_from_chars(NULL, pwindow->dst, - _("Disband unit"), adj_font(12), 0); + buf = create_icon_button_from_chars_fonto(NULL, pwindow->dst, + _("Disband unit"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, buf->size.w); hh = MAX(hh, buf->size.h); @@ -510,8 +514,9 @@ static int units_orders_city_dlg_callback(struct widget *button) if (pcity_dlg->page == ARMY_PAGE) { if (punit->homecity != pcity_dlg->pcity->id) { /* Make new Homecity */ - buf = create_icon_button_from_chars(NULL, pwindow->dst, - action_id_name_translation(ACTION_HOME_CITY), adj_font(12), 0); + buf = create_icon_button_from_chars_fonto(NULL, pwindow->dst, + action_id_name_translation(ACTION_HOME_CITY), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, buf->size.w); hh = MAX(hh, buf->size.h); @@ -524,8 +529,9 @@ static int units_orders_city_dlg_callback(struct widget *button) if (can_upgrade_unittype(client.conn.playing, putype)) { /* Upgrade unit */ - buf = create_icon_button_from_chars(NULL, pwindow->dst, - _("Upgrade unit"), adj_font(12), 0); + buf = create_icon_button_from_chars_fonto(NULL, pwindow->dst, + _("Upgrade unit"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, buf->size.w); hh = MAX(hh, buf->size.h); @@ -538,8 +544,9 @@ static int units_orders_city_dlg_callback(struct widget *button) /* ----- */ /* Cancel */ - buf = create_icon_button_from_chars(NULL, pwindow->dst, - _("Cancel"), adj_font(12), 0); + buf = create_icon_button_from_chars_fonto(NULL, pwindow->dst, + _("Cancel"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, buf->size.w); hh = MAX(hh, buf->size.h); @@ -1210,7 +1217,7 @@ void popup_hurry_production_dialog(struct city *pcity, SDL_Surface *pdest) } } - pstr = create_utf8_from_char(_("Buy it?"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Buy it?"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); pwindow->action = hurry_production_window_callback; @@ -1235,9 +1242,9 @@ void popup_hurry_production_dialog(struct city *pcity, SDL_Surface *pdest) area.w = MAX(area.w , text->w); area.h += text->h + adj_size(5); - buf = create_themeicon_button_from_chars(current_theme->cancel_icon, - pwindow->dst, _("No"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->cancel_icon, + pwindow->dst, _("No"), + FONTO_ATTENTION, 0); buf->action = cancel_buy_prod_city_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1247,8 +1254,10 @@ void popup_hurry_production_dialog(struct city *pcity, SDL_Surface *pdest) add_to_gui_list(ID_BUTTON, buf); if (city_can_buy(pcity) && (value <= client.conn.playing->economic.gold)) { - buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst, - _("Yes"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->ok_icon, + pwindow->dst, + _("Yes"), + FONTO_ATTENTION, 0); buf->action = ok_buy_prod_city_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1425,11 +1434,11 @@ static int sell_imprvm_dlg_callback(struct widget *impr) unselect_widget_action(); disable_city_dlg_widgets(); - pstr = create_utf8_from_char(_("Sell it?"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Sell it?"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); /*pwindow->action = move_sell_imprvm_dlg_callback; */ - /*set_wstate( pwindow, FC_WS_NORMAL ); */ + /*set_wstate(pwindow, FC_WS_NORMAL); */ add_to_gui_list(ID_WINDOW, pwindow); pcity_dlg->end_city_menu_widget_list = pwindow; @@ -3552,7 +3561,7 @@ void real_city_dialog_popup(struct city *pcity) pcity_dlg->pcity = pcity; pcity_dlg->page = ARMY_PAGE; - pstr = create_utf8_str(NULL, 0, adj_font(12)); + pstr = create_utf8_str_fonto(NULL, 0, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window(NULL, pstr, adj_size(640), adj_size(480), 0); @@ -3582,11 +3591,11 @@ void real_city_dialog_popup(struct city *pcity) /* ============================================================= */ - /* close dialog button */ + /* Close dialog button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); buf->action = exit_city_dlg_callback; buf->size.x = area.x + area.w - buf->size.w; buf->size.y = pwindow->size.y + adj_size(2); @@ -3598,8 +3607,8 @@ void real_city_dialog_popup(struct city *pcity) buf = create_themeicon(current_theme->army_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Present units"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Present units"), + FONTO_ATTENTION); buf->action = army_city_dlg_callback; buf->size.x = area.x + adj_size(2) + ((adj_size(183) - 5 * buf->size.w) / 6); buf->size.y = area.y + adj_size(2); @@ -3609,8 +3618,8 @@ void real_city_dialog_popup(struct city *pcity) buf = create_themeicon(current_theme->support_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Supported units"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Supported units"), + FONTO_ATTENTION); buf->action = supported_unit_city_dlg_callback; buf->size.x = area.x + adj_size(2) + 2 * ((adj_size(183) - 5 * buf->size.w) / 6) + buf->size.w; @@ -3622,10 +3631,11 @@ void real_city_dialog_popup(struct city *pcity) buf = create_themeicon(current_theme->happy_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Happiness"), adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Happiness"), + FONTO_ATTENTION); buf->action = happy_city_dlg_callback; - buf->size.x = - area.x + adj_size(2) + 3 * ((adj_size(183) - 5 * buf->size.w) / 6) + 2 * buf->size.w; + buf->size.x + = area.x + adj_size(2) + 3 * ((adj_size(183) - 5 * buf->size.w) / 6) + 2 * buf->size.w; buf->size.y = area.y + adj_size(2); set_wstate(buf, FC_WS_NORMAL); add_to_gui_list(ID_CITY_DLG_HAPPY_BUTTON, buf); @@ -3633,10 +3643,11 @@ void real_city_dialog_popup(struct city *pcity) buf = create_themeicon(current_theme->info_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("City info"), adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("City info"), + FONTO_ATTENTION); buf->action = info_city_dlg_callback; - buf->size.x = - area.x + adj_size(4) + 4 * ((adj_size(183) - 5 * buf->size.w) / 6) + 3 * buf->size.w; + buf->size.x + = area.x + adj_size(4) + 4 * ((adj_size(183) - 5 * buf->size.w) / 6) + 3 * buf->size.w; buf->size.y = area.y + adj_size(2); set_wstate(buf, FC_WS_NORMAL); add_to_gui_list(ID_CITY_DLG_INFO_BUTTON, buf); @@ -3665,10 +3676,11 @@ void real_city_dialog_popup(struct city *pcity) buf = create_themeicon(current_theme->options_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("City options"), adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("City options"), + FONTO_ATTENTION); buf->action = options_city_dlg_callback; - buf->size.x = - area.x + adj_size(4) + 5 * ((adj_size(183) - 5 * buf->size.w) / 6) + 4 * buf->size.w; + buf->size.x + = area.x + adj_size(4) + 5 * ((adj_size(183) - 5 * buf->size.w) / 6) + 4 * buf->size.w; buf->size.y = area.y + adj_size(2); if (owner == client.conn.playing) { set_wstate(buf, FC_WS_NORMAL); @@ -3678,8 +3690,8 @@ void real_city_dialog_popup(struct city *pcity) buf = create_themeicon(current_theme->prod_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Change production"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Change production"), + FONTO_ATTENTION); buf->action = change_prod_dlg_callback; buf->size.x = area.x + adj_size(7); buf->size.y = area.y + area.h - buf->size.h - adj_size(5); @@ -3692,8 +3704,8 @@ void real_city_dialog_popup(struct city *pcity) buf = create_themeicon(current_theme->buy_prod_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Hurry production"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Hurry production"), + FONTO_ATTENTION); buf->action = buy_prod_city_dlg_callback; buf->size.x = area.x + adj_size(7) + (buf->size.w + adj_size(2)); buf->size.y = area.y + area.h - buf->size.h - adj_size(5); @@ -3707,8 +3719,8 @@ void real_city_dialog_popup(struct city *pcity) buf = create_themeicon(current_theme->cma_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Citizen Governor"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Citizen Governor"), + FONTO_ATTENTION); buf->action = cma_city_dlg_callback; buf->key = SDLK_a; buf->size.x = area.x + adj_size(7) + (buf->size.w + adj_size(2)) * 2; @@ -3722,8 +3734,8 @@ void real_city_dialog_popup(struct city *pcity) /* -------- */ buf = create_themeicon(current_theme->l_arrow_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Previous city"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Previous city"), + FONTO_ATTENTION); buf->action = next_prev_city_dlg_callback; buf->size.x = area.x + adj_size(220) - buf->size.w - adj_size(8); buf->size.y = area.y + area.h - buf->size.h; @@ -3737,7 +3749,8 @@ void real_city_dialog_popup(struct city *pcity) buf = create_themeicon(current_theme->r_arrow_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Next city"), adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Next city"), + FONTO_ATTENTION); buf->action = next_prev_city_dlg_callback; buf->size.x = area.x + adj_size(420) + adj_size(2); buf->size.y = area.y + area.h - buf->size.h; diff --git a/client/gui-sdl2/cityrep.c b/client/gui-sdl2/cityrep.c index 05cded9bf0..07f4baf4b6 100644 --- a/client/gui-sdl2/cityrep.c +++ b/client/gui-sdl2/cityrep.c @@ -222,7 +222,7 @@ static void real_info_city_report_dialog_update(void) cma_icon = create_icon_from_theme(current_theme->cma_icon, 0); /* --------------- */ - pstr = create_utf8_from_char(_("Cities Report"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Cities Report"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -235,23 +235,24 @@ static void real_info_city_report_dialog_update(void) area = pwindow->area; /* ------------------------- */ - /* exit button */ + /* Exit button */ pbuf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pbuf->info_label = create_utf8_from_char(_("Close Dialog"), adj_font(12)); + pbuf->info_label = create_utf8_from_char_fonto(_("Close Dialog"), + FONTO_ATTENTION); pbuf->action = exit_city_report_callback; set_wstate(pbuf, FC_WS_NORMAL); pbuf->key = SDLK_ESCAPE; add_to_gui_list(ID_BUTTON, pbuf); -/* FIXME: not implemented yet */ +/* FIXME: Not implemented yet */ #if 0 /* ------------------------- */ pbuf = create_themeicon(current_theme->info_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pbuf->info_label = create_str16_from_char(_("Information Report"), - adj_font(12)); + pbuf->info_label = create_utf8_from_char_fonto(_("Information Report"), + FONTO_ATTENTION); /* pbuf->action = info_city_report_callback; set_wstate(pbuf, FC_WS_NORMAL); @@ -260,8 +261,8 @@ static void real_info_city_report_dialog_update(void) /* -------- */ pbuf = create_themeicon(current_theme->happy_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pbuf->info_label = create_str16_from_char(_("Happiness Report"), - adj_font(12)); + pbuf->info_label = create_utf8_from_char_fonto(_("Happiness Report"), + FONTO_ATTENTION); /* pbuf->action = happy_city_report_callback; set_wstate(pbuf, FC_WS_NORMAL); @@ -271,8 +272,8 @@ static void real_info_city_report_dialog_update(void) pbuf = create_themeicon(current_theme->army_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pbuf->info_label = create_str16_from_char(_("Garrison Report"), - adj_font(12)); + pbuf->info_label = create_utf8_from_char_fonto(_("Garrison Report"), + FONTO_ATTENTION); /* pbuf->action = army_city_dlg_callback; set_wstate(pbuf, FC_WS_NORMAL); @@ -281,8 +282,8 @@ static void real_info_city_report_dialog_update(void) /* -------- */ pbuf = create_themeicon(current_theme->support_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pbuf->info_label = create_str16_from_char(_("Maintenance Report"), - adj_font(12)); + pbuf->info_label = create_utf8_from_char_fonto(_("Maintenance Report"), + FONTO_ATTENTION); /* pbuf->action = supported_unit_city_dlg_callback; set_wstate(pbuf, FC_WS_NORMAL); @@ -294,7 +295,7 @@ static void real_info_city_report_dialog_update(void) last = pbuf; count = 0; city_list_iterate(client.conn.playing->cities, pcity) { - pstr = create_utf8_from_char(city_name_get(pcity), adj_font(12)); + pstr = create_utf8_from_char_fonto(city_name_get(pcity), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pbuf = create_iconlabel(NULL, pwindow->dst, pstr, (WF_RESTORE_BACKGROUND | WF_SELECT_WITHOUT_BAR)); diff --git a/client/gui-sdl2/cma_fe.c b/client/gui-sdl2/cma_fe.c index 58053a7bbf..97dc89c65c 100644 --- a/client/gui-sdl2/cma_fe.c +++ b/client/gui-sdl2/cma_fe.c @@ -316,7 +316,8 @@ static int save_cma_callback(struct widget *pwidget) cma->adv = fc_calloc(1, sizeof(struct advanced_dialog)); - pstr = create_utf8_from_char(_("Name new preset"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Name new preset"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -344,7 +345,8 @@ static int save_cma_callback(struct widget *pwidget) /* ============================================================= */ buf = create_edit(NULL, pwindow->dst, - create_utf8_from_char(_("new preset"), adj_font(12)), + create_utf8_from_char_fonto(_("new preset"), + FONTO_ATTENTION), adj_size(100), (WF_RESTORE_BACKGROUND|WF_FREE_STRING)); set_wstate(buf, FC_WS_NORMAL); @@ -354,9 +356,10 @@ static int save_cma_callback(struct widget *pwidget) add_to_gui_list(ID_EDIT, buf); /* ============================================================= */ - buf = create_themeicon_button_from_chars(current_theme->ok_icon, - pwindow->dst, - _("Yes"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->ok_icon, + pwindow->dst, + _("Yes"), + FONTO_ATTENTION, 0); buf->action = ok_save_cma_callback; set_wstate(buf, FC_WS_NORMAL); @@ -364,9 +367,9 @@ static int save_cma_callback(struct widget *pwidget) add_to_gui_list(ID_BUTTON, buf); buf->data.ptr = (void *)buf->next; - buf = create_themeicon_button_from_chars(current_theme->cancel_icon, - pwindow->dst, _("No"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->cancel_icon, + pwindow->dst, _("No"), + FONTO_ATTENTION, 0); buf->action = cancel_sld_cma_callback; set_wstate(buf, FC_WS_NORMAL); buf->key = SDLK_ESCAPE; @@ -500,7 +503,7 @@ static void popup_load_del_presets_dialog(bool load, struct widget *button) cma->adv = fc_calloc(1, sizeof(struct advanced_dialog)); - pstr = create_utf8_from_char(_("Presets"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Presets"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -514,11 +517,11 @@ static void popup_load_del_presets_dialog(bool load, struct widget *button) area = pwindow->area; /* ---------- */ - /* create exit button */ + /* Create exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); buf->action = cancel_sld_cma_callback; set_wstate(buf, FC_WS_NORMAL); buf->key = SDLK_ESCAPE; @@ -793,15 +796,15 @@ void update_city_cma_dialog(void) } } - /* create result text surface */ - pstr = create_utf8_from_char(cmafec_get_result_descr(cma->pcity, result, - &cma->edited_cm_parm), - adj_font(12)); + /* Create result text surface */ + pstr = create_utf8_from_char_fonto(cmafec_get_result_descr(cma->pcity, result, + &cma->edited_cm_parm), + FONTO_ATTENTION); text = create_text_surf_from_utf8(pstr); FREEUTF8STR(pstr); - /* fill result text background */ + /* Fill result text background */ dst.x = buf->area.x + adj_size(7); dst.y = buf->area.y + adj_size(186); dst.w = text->w + adj_size(10); @@ -817,7 +820,7 @@ void update_city_cma_dialog(void) alphablit(text, NULL, buf->dst->surface, &dst, 255); FREESURFACE(text); - /* happy factor scrollbar */ + /* Happy factor scrollbar */ buf = cma->dlg->begin_widget_list->next->next->next->next->next->next->next; if (client_under_control && get_checkbox_state(buf->prev)) { set_wstate(buf, FC_WS_NORMAL); @@ -825,7 +828,7 @@ void update_city_cma_dialog(void) set_wstate(buf, FC_WS_DISABLED); } - /* save as ... */ + /* Save as ... */ buf = buf->prev->prev; if (client_under_control) { set_wstate(buf, FC_WS_NORMAL); @@ -833,7 +836,7 @@ void update_city_cma_dialog(void) set_wstate(buf, FC_WS_DISABLED); } - /* load */ + /* Load */ buf = buf->prev; if (cma_presets_exist && client_under_control) { set_wstate(buf, FC_WS_NORMAL); @@ -841,7 +844,7 @@ void update_city_cma_dialog(void) set_wstate(buf, FC_WS_DISABLED); } - /* del */ + /* Del */ buf = buf->prev; if (cma_presets_exist && client_under_control) { set_wstate(buf, FC_WS_NORMAL); @@ -865,7 +868,7 @@ void update_city_cma_dialog(void) set_wstate(buf, FC_WS_DISABLED); } - /* stop */ + /* Stop */ buf = buf->prev; if (client_under_control && controlled) { set_wstate(buf, FC_WS_NORMAL); @@ -917,7 +920,7 @@ void popup_city_cma_dialog(struct city *pcity) population_to_text(city_population(pcity)), _("Citizen Governor")); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -930,11 +933,11 @@ void popup_city_cma_dialog(struct city *pcity) area = pwindow->area; /* ---------- */ - /* create exit button */ + /* Create exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); buf->action = exit_cma_dialog_callback; set_wstate(buf, FC_WS_NORMAL); buf->key = SDLK_ESCAPE; @@ -942,7 +945,7 @@ void popup_city_cma_dialog(struct city *pcity) add_to_gui_list(ID_BUTTON, buf); - pstr = create_utf8_str(NULL, 0, adj_font(12)); + pstr = create_utf8_str_fonto(NULL, 0, FONTO_ATTENTION); text_w = 0; copy_chars_to_utf8_str(pstr, _("Minimal Surplus")); @@ -1217,19 +1220,19 @@ void popup_city_cma_dialog(struct city *pcity) area.x, area.y, area.w - 1, area.h - 1, get_theme_color(COLOR_THEME_CMA_FRAME)); - /* celebrate cbox */ + /* Celebrate cbox */ buf = buf->prev; buf->size.x = pwindow->size.x + dst.x + adj_size(10); buf->size.y = pwindow->size.y + dst.y; - /* celebrate static text */ + /* Celebrate static text */ dst.x += (adj_size(10) + buf->size.w + adj_size(5)); dst.y += (buf->size.h - text[O_LAST]->h) / 2; alphablit(text[O_LAST], NULL, pwindow->theme, &dst, 255); FREESURFACE(text[O_LAST]); /* ------------------------ */ - /* save as */ + /* Save as */ buf = buf->prev; buf->size.x = pwindow->size.x + x + (w - (buf->size.w + adj_size(6)) * 6) / 2; buf->size.y = pwindow->size.y + pwindow->size.h - buf->size.h * 2 - adj_size(10); @@ -1244,33 +1247,33 @@ void popup_city_cma_dialog(struct city *pcity) area.x, area.y, area.w - 1, area.h - 1, get_theme_color(COLOR_THEME_CMA_FRAME)); - /* load */ + /* Load */ buf = buf->prev; buf->size.x = buf->next->size.x + buf->next->size.w + adj_size(4); buf->size.y = buf->next->size.y; - /* del */ + /* Del */ buf = buf->prev; buf->size.x = buf->next->size.x + buf->next->size.w + adj_size(4); buf->size.y = buf->next->size.y; - /* run */ + /* Run */ buf = buf->prev; buf->size.x = buf->next->size.x + buf->next->size.w + adj_size(4); buf->size.y = buf->next->size.y; - /* run one time */ + /* Run one time */ buf = buf->prev; buf->size.x = buf->next->size.x + buf->next->size.w + adj_size(4); buf->size.y = buf->next->size.y; - /* del */ + /* Del */ buf = buf->prev; buf->size.x = buf->next->size.x + buf->next->size.w + adj_size(4); buf->size.y = buf->next->size.y; /* ------------------------ */ - /* check if Citizen Icons style was loaded */ + /* Check if Citizen Icons style was loaded */ cs = style_of_city(cma->pcity); if (cs != icons->style) { diff --git a/client/gui-sdl2/connectdlg.c b/client/gui-sdl2/connectdlg.c index a38e6ba94d..2e1413903c 100644 --- a/client/gui-sdl2/connectdlg.c +++ b/client/gui-sdl2/connectdlg.c @@ -793,15 +793,15 @@ static void popup_user_passwd_dialog(const char *message) area = pwindow->area; - /* text label */ - label_str = create_utf8_from_char(message, adj_font(12)); + /* Text label */ + label_str = create_utf8_from_char_fonto(message, FONTO_ATTENTION); label_str->fgcol = *get_theme_color(COLOR_THEME_USERPASSWDDLG_TEXT); buf = create_iconlabel(NULL, pwindow->dst, label_str, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); add_to_gui_list(ID_LABEL, buf); area.h += adj_size(10) + buf->size.h + adj_size(5); - /* password edit */ + /* Password edit */ buf = create_edit(NULL, pwindow->dst, create_utf8_str(NULL, 0, adj_font(16)), adj_size(210), (WF_PASSWD_EDIT|WF_RESTORE_BACKGROUND|WF_FREE_DATA)); @@ -851,7 +851,7 @@ static void popup_user_passwd_dialog(const char *message) (main_window_width() - pwindow->size.w) / 2, (main_window_height() - pwindow->size.h) / 2); - /* text label */ + /* Text label */ buf = connect_dlg->end_widget_list->prev; start_x = area.x + (area.w - buf->size.w) / 2; @@ -862,7 +862,7 @@ static void popup_user_passwd_dialog(const char *message) start_y += buf->size.h + adj_size(5); - /* password edit */ + /* Password edit */ buf = buf->prev; start_x = area.x + (area.w - buf->size.w) / 2; @@ -957,15 +957,15 @@ static void popup_new_user_passwd_dialog(const char *message) area = pwindow->area; - /* text label */ - label_str = create_utf8_from_char(message, adj_font(12)); + /* Text label */ + label_str = create_utf8_from_char_fonto(message, FONTO_ATTENTION); label_str->fgcol = *get_theme_color(COLOR_THEME_USERPASSWDDLG_TEXT); buf = create_iconlabel(NULL, pwindow->dst, label_str, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); add_to_gui_list(ID_LABEL, buf); area.h += adj_size(10) + buf->size.h + adj_size(5); - /* password edit */ + /* Password edit */ buf = create_edit(NULL, pwindow->dst, create_utf8_str(NULL, 0, adj_font(16)), adj_size(210), (WF_PASSWD_EDIT|WF_RESTORE_BACKGROUND|WF_FREE_DATA)); @@ -974,7 +974,7 @@ static void popup_new_user_passwd_dialog(const char *message) add_to_gui_list(ID_EDIT, buf); area.h += buf->size.h + adj_size(5); - /* second password edit */ + /* Second password edit */ buf = create_edit(NULL, pwindow->dst, create_utf8_str(NULL, 0, adj_font(16)), adj_size(210), (WF_PASSWD_EDIT|WF_RESTORE_BACKGROUND|WF_FREE_DATA)); diff --git a/client/gui-sdl2/dialogs.c b/client/gui-sdl2/dialogs.c index 278ea86a96..3a00e6932e 100644 --- a/client/gui-sdl2/dialogs.c +++ b/client/gui-sdl2/dialogs.c @@ -143,7 +143,7 @@ void put_window_near_map_tile(struct widget *pwindow, /**********************************************************************//** This function is called when the client disconnects or the game is - over. It should close all dialog windows for that game. + over. It should close all dialog windows for that game. **************************************************************************/ void popdown_all_game_dialogs(void) { @@ -320,7 +320,7 @@ static struct notify_goto_dialog *notify_goto_dialog_new(void) utf8_str *str; /* Window. */ - str = create_utf8_from_char("", adj_font(12)); + str = create_utf8_from_char_fonto("", FONTO_ATTENTION); str->style |= TTF_STYLE_BOLD; pdialog->window = create_window_skeleton(NULL, str, 0); @@ -334,8 +334,8 @@ static struct notify_goto_dialog *notify_goto_dialog_new(void) pdialog->window->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pdialog->close_button->info_label = - create_utf8_from_char(_("Close Dialog (Esc)"), adj_font(12)); + pdialog->close_button->info_label + = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), FONTO_ATTENTION); pdialog->close_button->action = notify_goto_dialog_close_callback; pdialog->close_button->data.ptr = pdialog; set_wstate(pdialog->close_button, FC_WS_NORMAL); @@ -388,9 +388,10 @@ static void notify_goto_dialog_update(struct notify_goto_dialog *pdialog) if (NULL != pdialog->label) { del_widget_pointer_from_gui_list(pdialog->label); } - pdialog->label = create_iconlabel_from_chars(NULL, pdialog->window->dst, - pdata->lines, adj_font(12), - WF_RESTORE_BACKGROUND); + pdialog->label = create_iconlabel_from_chars_fonto(NULL, pdialog->window->dst, + pdata->lines, + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); pdialog->label->action = notify_goto_dialog_goto_callback; pdialog->label->data.ptr = pdialog; set_wstate(pdialog->label, FC_WS_NORMAL); @@ -433,7 +434,7 @@ static void notify_goto_dialog_advance(struct notify_goto_dialog *pdialog) /**********************************************************************//** Popup a dialog to display information about an event that has a - specific location. The user should be given the option to goto that + specific location. The user should be given the option to goto that location. **************************************************************************/ void popup_notify_goto_dialog(const char *headline, const char *lines, @@ -521,7 +522,7 @@ void popup_notify_dialog(const char *caption, const char *headline, notify_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); - pstr = create_utf8_from_char(caption, adj_font(12)); + pstr = create_utf8_from_char_fonto(caption, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -535,11 +536,11 @@ void popup_notify_dialog(const char *caption, const char *headline, area = pwindow->area; /* ---------- */ - /* create exit button */ + /* Create exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); buf->action = exit_notify_dialog_callback; set_wstate(buf, FC_WS_NORMAL); buf->key = SDLK_ESCAPE; @@ -554,7 +555,7 @@ void popup_notify_dialog(const char *caption, const char *headline, headline_surf = create_text_surf_from_utf8(pstr); if (lines && *lines != '\0') { - change_ptsize_utf8(pstr, adj_font(12)); + change_fonto_utf8(pstr, FONTO_ATTENTION); pstr->style &= ~TTF_STYLE_BOLD; copy_chars_to_utf8_str(pstr, lines); lines_surf = create_text_surf_from_utf8(pstr); @@ -699,7 +700,8 @@ void popup_unit_upgrade_dlg(struct unit *punit, bool city) unit_upgrade_result = unit_upgrade_info(punit, cbuf, sizeof(cbuf)); - pstr = create_utf8_from_char(_("Upgrade Obsolete Units"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Upgrade Obsolete Units"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -727,9 +729,9 @@ void popup_unit_upgrade_dlg(struct unit *punit, bool city) area.h += (text->h + adj_size(10)); /* Cancel button */ - buf = create_themeicon_button_from_chars(current_theme->cancel_icon, - pwindow->dst, _("Cancel"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->cancel_icon, + pwindow->dst, _("Cancel"), + FONTO_ATTENTION, 0); buf->action = cancel_upgrade_unit_callback; set_wstate(buf, FC_WS_NORMAL); @@ -739,8 +741,10 @@ void popup_unit_upgrade_dlg(struct unit *punit, bool city) add_to_gui_list(ID_BUTTON, buf); if (UU_OK == unit_upgrade_result) { - buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst, - _("Upgrade"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->ok_icon, + pwindow->dst, + _("Upgrade"), + FONTO_ATTENTION, 0); buf->action = ok_upgrade_unit_window_callback; set_wstate(buf, FC_WS_NORMAL); @@ -897,7 +901,7 @@ void popup_unit_disband_dlg(struct unit *punit, bool city) unit_list_destroy(punits); } - pstr = create_utf8_from_char(_("Disband Units"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Disband Units"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -925,9 +929,9 @@ void popup_unit_disband_dlg(struct unit *punit, bool city) area.h += (text->h + adj_size(10)); /* Cancel button */ - buf = create_themeicon_button_from_chars(current_theme->cancel_icon, - pwindow->dst, _("Cancel"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->cancel_icon, + pwindow->dst, _("Cancel"), + FONTO_ATTENTION, 0); buf->action = cancel_disband_unit_callback; set_wstate(buf, FC_WS_NORMAL); @@ -937,8 +941,10 @@ void popup_unit_disband_dlg(struct unit *punit, bool city) add_to_gui_list(ID_BUTTON, buf); if (unit_disband_result) { - buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst, - _("Disband"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->ok_icon, + pwindow->dst, + _("Disband"), + FONTO_ATTENTION, 0); buf->action = ok_disband_unit_window_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1103,8 +1109,8 @@ void unit_select_dialog_popup(struct tile *ptile) is_unit_move_blocked = TRUE; unit_select_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); - fc_snprintf(cbuf , sizeof(cbuf), "%s (%d)", _("Unit selection") , n); - pstr = create_utf8_from_char(cbuf , adj_font(12)); + fc_snprintf(cbuf, sizeof(cbuf), "%s (%d)", _("Unit selection"), n); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -1118,11 +1124,11 @@ void unit_select_dialog_popup(struct tile *ptile) area = pwindow->area; /* ---------- */ - /* create exit button */ + /* Create exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); buf->action = exit_unit_select_callback; set_wstate(buf, FC_WS_NORMAL); buf->key = SDLK_ESCAPE; @@ -1336,7 +1342,10 @@ static void popup_terrain_info_dialog(SDL_Surface *pdest, struct tile *ptile) fc_snprintf(cbuf, sizeof(cbuf), "%s [%d,%d]", _("Terrain Info"), TILE_XY(ptile)); - pwindow = create_window_skeleton(NULL, create_utf8_from_char(cbuf , adj_font(12)), 0); + pwindow + = create_window_skeleton(NULL, + create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION), + 0); pwindow->string_utf8->style |= TTF_STYLE_BOLD; pwindow->action = terrain_info_window_dlg_callback; @@ -1348,7 +1357,8 @@ static void popup_terrain_info_dialog(SDL_Surface *pdest, struct tile *ptile) area = pwindow->area; /* ---------- */ - pstr = create_utf8_from_char(popup_info_text(ptile), adj_font(12)); + pstr = create_utf8_from_char_fonto(popup_info_text(ptile), + FONTO_ATTENTION); pstr->style |= SF_CENTER; buf = create_iconlabel(surf, pwindow->dst, pstr, 0); @@ -1373,11 +1383,11 @@ static void popup_terrain_info_dialog(SDL_Surface *pdest, struct tile *ptile) buf->size.x = area.x + adj_size(10); buf->size.y = area.y; - /* exit icon */ + /* Exit icon */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); buf->size.x = area.x + area.w - buf->size.w - 1; buf->size.y = pwindow->size.y + adj_size(2); buf->action = exit_terrain_info_dialog_callback; @@ -1719,7 +1729,7 @@ void popup_advanced_terrain_dialog(struct tile *ptile, cont->id0 = index_to_map_pos_x(tile_index(ptile)); cont->id1 = index_to_map_pos_y(tile_index(ptile)); - pstr = create_utf8_from_char(_("Advanced Menu") , adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Advanced Menu"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -1736,8 +1746,8 @@ void popup_advanced_terrain_dialog(struct tile *ptile, /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += buf->size.w + adj_size(10); buf->action = exit_advanced_terrain_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -2286,8 +2296,8 @@ void popup_pillage_dialog(struct unit *punit, bv_extras extras) is_unit_move_blocked = TRUE; pillage_dlg = fc_calloc(1, sizeof(struct small_dialog)); - /* window */ - pstr = create_utf8_from_char(_("What To Pillage") , adj_font(12)); + /* Window */ + pstr = create_utf8_from_char_fonto(_("What To Pillage"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -2303,11 +2313,11 @@ void popup_pillage_dialog(struct unit *punit, bv_extras extras) area.h = MAX(area.h, adj_size(2)); /* ---------- */ - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += buf->size.w + adj_size(10); buf->action = exit_pillage_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -2454,7 +2464,8 @@ void popup_government_dialog(void) gov_dlg = fc_calloc(1, sizeof(struct small_dialog)); /* Create window */ - pstr = create_utf8_from_char(_("Choose Your New Government"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Choose Your New Government"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; /* This win. size is temp. */ pwindow = create_window_skeleton(NULL, pstr, 0); @@ -2473,9 +2484,10 @@ void popup_government_dialog(void) } if (can_change_to_government(client.conn.playing, gov)) { - pstr = create_utf8_from_char(government_name_translation(gov), adj_font(12)); - gov_button = - create_icon_button(get_government_surface(gov), pwindow->dst, pstr, 0); + pstr = create_utf8_from_char_fonto(government_name_translation(gov), + FONTO_ATTENTION); + gov_button + = create_icon_button(get_government_surface(gov), pwindow->dst, pstr, 0); gov_button->action = government_dlg_callback; max_w = MAX(max_w, gov_button->size.w); @@ -2894,7 +2906,7 @@ static int nation_button_callback(struct widget *nation_button) redraw_group(nation_dlg->begin_widget_list, nation_dlg->end_widget_list, 0); widget_flush(nation_dlg->end_widget_list); } else { - /* pop up nation description */ + /* Pop up nation description */ struct widget *pwindow, *ok_button; utf8_str *pstr; SDL_Surface *text; @@ -2907,8 +2919,8 @@ static int nation_button_callback(struct widget *nation_button) if (!help_dlg) { help_dlg = fc_calloc(1, sizeof(struct small_dialog)); - pstr = create_utf8_from_char(nation_plural_translation(pnation), - adj_font(12)); + pstr = create_utf8_from_char_fonto(nation_plural_translation(pnation), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -2940,7 +2952,7 @@ static int nation_button_callback(struct widget *nation_button) char info[4096]; helptext_nation(info, sizeof(info), pnation, NULL); - pstr = create_utf8_from_char(info, adj_font(12)); + pstr = create_utf8_from_char_fonto(info, FONTO_ATTENTION); } pstr->fgcol = *get_theme_color(COLOR_THEME_NATIONDLG_LEGEND); @@ -3125,7 +3137,8 @@ void popup_races_dialog(struct player *pplayer) nation_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); /* Create window widget */ - pstr = create_utf8_from_char(_("What nation will you be?"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("What nation will you be?"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window(NULL, pstr, w, h, WF_FREE_DATA); @@ -3148,7 +3161,7 @@ void popup_races_dialog(struct player *pplayer) 0, 0, main_bg->w - 1, main_bg->h - 1, get_theme_color(COLOR_THEME_NATIONDLG_FRAME)); - pstr = create_utf8_str(NULL, 0, adj_font(12)); + pstr = create_utf8_str_fonto(NULL, 0, FONTO_ATTENTION); pstr->style |= (SF_CENTER|TTF_STYLE_BOLD); pstr->bgcol = (SDL_Color) {0, 0, 0, 0}; @@ -3164,7 +3177,7 @@ void popup_races_dialog(struct player *pplayer) tmp_surf = crop_rect_from_surface(main_bg, NULL); copy_chars_to_utf8_str(pstr, nation_plural_translation(pnation)); - change_ptsize_utf8(pstr, adj_font(12)); + change_fonto_utf8(pstr, FONTO_ATTENTION); text_name = create_text_surf_smaller_than_w(pstr, tmp_surf->w - adj_size(4)); @@ -3218,7 +3231,8 @@ void popup_races_dialog(struct player *pplayer) utf8_str *natset_str; struct option *poption; - natset_str = create_utf8_from_char(_("Nation set"), adj_font(12)); + natset_str = create_utf8_from_char_fonto(_("Nation set"), + FONTO_ATTENTION); change_ptsize_utf8(natset_str, adj_font(24)); nationsets = create_iconlabel(NULL, pwindow->dst, natset_str, 0); add_to_gui_list(ID_LABEL, nationsets); @@ -3227,8 +3241,9 @@ void popup_races_dialog(struct player *pplayer) poption = optset_option_by_name(server_optset, "nationset"); setup->set = nation_set_by_setting_value(option_str_get(poption)); - natset_str = create_utf8_from_char(nation_set_name_translation(setup->set), - adj_font(12)); + natset_str + = create_utf8_from_char_fonto(nation_set_name_translation(setup->set), + FONTO_ATTENTION); change_ptsize_utf8(natset_str, adj_font(24)); pwidget = create_iconlabel(NULL, pwindow->dst, natset_str, 0); @@ -3349,18 +3364,20 @@ void popup_races_dialog(struct player *pplayer) /* ---------------------------------------------------------- */ /* Create Cancel button */ - pwidget = create_themeicon_button_from_chars(current_theme->cancel_icon, + pwidget + = create_themeicon_button_from_chars_fonto(current_theme->cancel_icon, pwindow->dst, _("Cancel"), - adj_font(12), 0); + FONTO_ATTENTION, 0); pwidget->action = races_dialog_cancel_callback; set_wstate(pwidget, FC_WS_NORMAL); add_to_gui_list(ID_NATION_WIZARD_DISCONNECT_BUTTON, pwidget); /* Create OK button */ - pwidget = - create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst, - _("OK"), adj_font(12), 0); + pwidget + = create_themeicon_button_from_chars_fonto(current_theme->ok_icon, + pwindow->dst, + _("OK"), FONTO_ATTENTION, 0); pwidget->action = races_dialog_ok_callback; set_wstate(pwidget, FC_WS_NORMAL); @@ -3506,7 +3523,7 @@ void popup_races_dialog(struct player *pplayer) } /**********************************************************************//** - Close the nation selection dialog. This should allow the user to + Close the nation selection dialog. This should allow the user to (at least) select a unit to activate. **************************************************************************/ void popdown_races_dialog(void) diff --git a/client/gui-sdl2/diplodlg.c b/client/gui-sdl2/diplodlg.c index a17466f74f..91ee5b47cd 100644 --- a/client/gui-sdl2/diplodlg.c +++ b/client/gui-sdl2/diplodlg.c @@ -478,7 +478,8 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, cont->id0 = player_number(pplayer0); cont->id1 = player_number(pplayer1); - pstr = create_utf8_from_char(nation_adjective_for_player(pplayer0), adj_font(12)); + pstr = create_utf8_from_char_fonto(nation_adjective_for_player(pplayer0), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, WF_FREE_DATA); @@ -506,9 +507,9 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, && pplayer_can_make_treaty(pplayer0, pplayer1, DS_ALLIANCE) == DIPL_OK; if (ceasefire || peace || alliance) { - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Pacts"), adj_font(12), - WF_RESTORE_BACKGROUND); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Pacts"), FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); width = buf->size.w; height = buf->size.h; @@ -518,8 +519,9 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, if (ceasefire) { fc_snprintf(cbuf, sizeof(cbuf), " %s", Q_("?diplomatic_state:Cease-fire")); - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - cbuf, adj_font(12), (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + cbuf, FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); @@ -533,9 +535,9 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, if (peace) { fc_snprintf(cbuf, sizeof(cbuf), " %s", Q_("?diplomatic_state:Peace")); - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - cbuf, adj_font(12), - (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + cbuf, FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); @@ -549,9 +551,9 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, if (alliance) { fc_snprintf(cbuf, sizeof(cbuf), " %s", Q_("?diplomatic_state:Alliance")); - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - cbuf, adj_font(12), - (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + cbuf, FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); @@ -569,9 +571,10 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, bool full_map, sea_map; if (clause_enabled(CLAUSE_VISION)) { - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Give shared vision"), adj_font(12), - (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Give shared vision"), + FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); @@ -586,11 +589,11 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, sea_map = clause_enabled(CLAUSE_SEAMAP); if (full_map || sea_map) { - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Maps"), adj_font(12), - WF_RESTORE_BACKGROUND); - buf->string_utf8->fgcol = - *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Maps"), FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); add_to_gui_list(ID_LABEL, buf); @@ -600,10 +603,11 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, if (full_map) { fc_snprintf(cbuf, sizeof(cbuf), " %s", _("World map")); - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - cbuf, adj_font(12), - (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + cbuf, FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); buf->action = maps_callback; @@ -616,10 +620,11 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, if (sea_map) { fc_snprintf(cbuf, sizeof(cbuf), " %s", _("Sea map")); - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - cbuf, adj_font(12), - (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + cbuf, FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); buf->action = maps_callback; @@ -633,10 +638,11 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, /* Don't take in account the embassy effects. */ if (clause_enabled(CLAUSE_EMBASSY) && !player_has_real_embassy(pplayer1, pplayer0)) { - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Give embassy"), adj_font(12), - (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Give embassy"), FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); buf->action = embassy_callback; @@ -651,9 +657,11 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, cont->value = pplayer0->economic.gold; fc_snprintf(cbuf, sizeof(cbuf), _("Gold(max %d)"), pplayer0->economic.gold); - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - cbuf, adj_font(12), WF_RESTORE_BACKGROUND); - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + cbuf, FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); add_to_gui_list(ID_LABEL, buf); @@ -687,10 +695,11 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, || research_invention_state(presearch1, i) == TECH_PREREQS_KNOWN)) { - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Advances"), adj_font(12), - WF_RESTORE_BACKGROUND); - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Advances"), FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); add_to_gui_list(ID_LABEL, buf); @@ -699,9 +708,11 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, fc_snprintf(cbuf, sizeof(cbuf), " %s", advance_name_translation(advance_by_number(i))); - buf = create_iconlabel_from_chars(NULL, pwindow->dst, cbuf, adj_font(12), - (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, cbuf, + FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); buf->action = techs_callback; @@ -726,9 +737,11 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, fc_snprintf(cbuf, sizeof(cbuf), " %s", advance_name_translation(advance_by_number(i))); - buf = create_iconlabel_from_chars(NULL, pwindow->dst, cbuf, adj_font(12), - (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, cbuf, + FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); buf->action = techs_callback; @@ -766,10 +779,11 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, } if (i > 0) { - buf = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Cities"), adj_font(12), - WF_RESTORE_BACKGROUND); - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Cities"), FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); buf->string_utf8->style &= ~SF_CENTER; width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); @@ -781,9 +795,11 @@ static struct advanced_dialog *popup_diplomatic_objects(struct player *pplayer0, for (j = 0; j < i; j++) { fc_snprintf(cbuf, sizeof(cbuf), " %s", city_name_get(city_list_ptrs[j])); - buf = create_iconlabel_from_chars(NULL, pwindow->dst, cbuf, adj_font(12), + buf = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, cbuf, + FONTO_ATTENTION, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, buf->size.w); height = MAX(height, buf->size.h); buf->data.cont = cont; @@ -910,7 +926,7 @@ static void update_diplomacy_dialog(struct diplomacy_dialog *pdialog) fc_snprintf(cbuf, sizeof(cbuf), _("Diplomacy meeting")); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -924,7 +940,8 @@ static void update_diplomacy_dialog(struct diplomacy_dialog *pdialog) /* ============================================================= */ - pstr = create_utf8_from_char(nation_adjective_for_player(pplayer0), adj_font(12)); + pstr = create_utf8_from_char_fonto(nation_adjective_for_player(pplayer0), + FONTO_ATTENTION); pstr->style |= (TTF_STYLE_BOLD|SF_CENTER); pstr->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); @@ -940,7 +957,8 @@ static void update_diplomacy_dialog(struct diplomacy_dialog *pdialog) add_to_gui_list(ID_ICON, buf); - pstr = create_utf8_from_char(nation_adjective_for_player(pplayer1), adj_font(12)); + pstr = create_utf8_from_char_fonto(nation_adjective_for_player(pplayer1), + FONTO_ATTENTION); pstr->style |= (TTF_STYLE_BOLD|SF_CENTER); pstr->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); @@ -958,8 +976,8 @@ static void update_diplomacy_dialog(struct diplomacy_dialog *pdialog) buf = create_themeicon(current_theme->cancel_pact_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Cancel meeting"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Cancel meeting"), + FONTO_ATTENTION); buf->action = cancel_meeting_callback; buf->data.cont = cont; set_wstate(buf, FC_WS_NORMAL); @@ -969,8 +987,8 @@ static void update_diplomacy_dialog(struct diplomacy_dialog *pdialog) buf = create_themeicon(current_theme->ok_pact_icon, pwindow->dst, WF_FREE_DATA | WF_WIDGET_HAS_INFO_LABEL |WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Accept treaty"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Accept treaty"), + FONTO_ATTENTION); buf->action = accept_treaty_callback; buf->data.cont = cont; set_wstate(buf, FC_WS_NORMAL); @@ -1108,7 +1126,7 @@ static void update_clauses_list(struct diplomacy_dialog *pdialog) clause_list_iterate(pdialog->treaty->clauses, pclause) { client_diplomacy_clause_string(cbuf, sizeof(cbuf), pclause); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pbuf = create_iconlabel(NULL, pwindow->dst, pstr, (WF_FREE_DATA|WF_DRAW_TEXT_LABEL_WITH_SPACE|WF_RESTORE_BACKGROUND)); @@ -1405,7 +1423,7 @@ static void popup_war_dialog(struct player *pplayer) /* TRANS: "Polish incident !" FIXME!!! */ _("%s incident !"), nation_adjective_for_player(pplayer)); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -1432,9 +1450,9 @@ static void popup_war_dialog(struct player *pplayer) area.w = MAX(area.w, text->w); area.h += text->h + adj_size(10); - buf = create_themeicon_button_from_chars(current_theme->cancel_icon, - pwindow->dst, _("No"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->cancel_icon, + pwindow->dst, _("No"), + FONTO_ATTENTION, 0); buf->action = cancel_sdip_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1443,8 +1461,10 @@ static void popup_war_dialog(struct player *pplayer) add_to_gui_list(ID_BUTTON, buf); - buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst, - _("Yes"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->ok_icon, + pwindow->dst, + _("Yes"), + FONTO_ATTENTION, 0); buf->action = cancel_pact_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1536,8 +1556,8 @@ void popup_diplomacy_dialog(struct player *pplayer) spy_dlg = fc_calloc(1, sizeof(struct small_dialog)); - fc_snprintf(cbuf, sizeof(cbuf), _("Foreign Minister")); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + fc_snprintf(cbuf, sizeof(cbuf), _("Foreign Minister")); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -1582,13 +1602,14 @@ void popup_diplomacy_dialog(struct player *pplayer) } /* Cancel treaty */ - buf = create_themeicon_button_from_chars(current_theme->units2_icon, - pwindow->dst, cbuf, - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->units2_icon, + pwindow->dst, cbuf, + FONTO_ATTENTION, 0); buf->action = cancel_pact_dlg_callback; set_wstate(buf, FC_WS_NORMAL); - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); buf->data.player = pplayer; buf->key = SDLK_c; add_to_gui_list(ID_BUTTON, buf); @@ -1603,15 +1624,17 @@ void popup_diplomacy_dialog(struct player *pplayer) if (shared) { /* Shared vision */ - buf = create_themeicon_button_from_chars(current_theme->units2_icon, - pwindow->dst, _("Withdraw vision"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->units2_icon, + pwindow->dst, + _("Withdraw vision"), + FONTO_ATTENTION, 0); buf->action = withdraw_vision_dlg_callback; set_wstate(buf, FC_WS_NORMAL); buf->data.player = pplayer; buf->key = SDLK_w; - buf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + buf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); add_to_gui_list(ID_BUTTON, buf); buf->size.w = MAX(buf->next->size.w, buf->size.w); buf->next->size.w = buf->size.w; @@ -1621,10 +1644,10 @@ void popup_diplomacy_dialog(struct player *pplayer) } /* Meet */ - buf = create_themeicon_button_from_chars(current_theme->players_icon, - pwindow->dst, - _("Call Diplomatic Meeting"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->players_icon, + pwindow->dst, + _("Call Diplomatic Meeting"), + FONTO_ATTENTION, 0); buf->action = call_meeting_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1638,9 +1661,10 @@ void popup_diplomacy_dialog(struct player *pplayer) button_h = MAX(button_h , buf->size.h); buttons++; - buf = create_themeicon_button_from_chars(current_theme->cancel_icon, - pwindow->dst, _("Send them back"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->cancel_icon, + pwindow->dst, + _("Send them back"), + FONTO_ATTENTION, 0); buf->action = cancel_sdip_dlg_callback; set_wstate(buf, FC_WS_NORMAL); diff --git a/client/gui-sdl2/finddlg.c b/client/gui-sdl2/finddlg.c index 3d4ec6a409..a58a87373f 100644 --- a/client/gui-sdl2/finddlg.c +++ b/client/gui-sdl2/finddlg.c @@ -147,7 +147,7 @@ void popup_find_dialog(void) find_city_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); - pstr = create_utf8_from_char(_("Find City") , adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Find City"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -161,12 +161,12 @@ void popup_find_dialog(void) area = pwindow->area; /* ---------- */ - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND | WF_FREE_DATA); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w = MAX(area.w, buf->size.w + adj_size(10)); buf->action = exit_find_city_dlg_callback; set_wstate(buf, FC_WS_NORMAL); diff --git a/client/gui-sdl2/gotodlg.c b/client/gui-sdl2/gotodlg.c index 4ca5a15852..e695fc85f9 100644 --- a/client/gui-sdl2/gotodlg.c +++ b/client/gui-sdl2/gotodlg.c @@ -160,7 +160,7 @@ static void update_goto_dialog(void) city_list_iterate(pplayer->cities, pcity) { - /* FIXME: should use unit_can_airlift_to(). */ + /* FIXME: Should use unit_can_airlift_to(). */ if (!GOTO && !pcity->airlift) { continue; } @@ -168,7 +168,7 @@ static void update_goto_dialog(void) fc_snprintf(cbuf, sizeof(cbuf), "%s (%d)", city_name_get(pcity), city_size_get(pcity)); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; if (!player_owns_city(owner, pcity)) { @@ -235,7 +235,7 @@ static void update_goto_dialog(void) hide_scrollbar(goto_dlg->scroll); } - /* redraw */ + /* Redraw */ redraw_group(goto_dlg->begin_widget_list, goto_dlg->end_widget_list, 0); widget_flush(goto_dlg->end_widget_list); } @@ -259,7 +259,8 @@ static void popup_goto_airlift_dialog(void) goto_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); - pstr = create_utf8_from_char(_("Select destination"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Select destination"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -273,11 +274,11 @@ static void popup_goto_airlift_dialog(void) area = pwindow->area; /* ---------- */ - /* create exit button */ + /* Create exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); buf->action = exit_goto_dialog_callback; set_wstate(buf, FC_WS_NORMAL); buf->key = SDLK_ESCAPE; @@ -307,9 +308,9 @@ static void popup_goto_airlift_dialog(void) | WF_WIDGET_HAS_INFO_LABEL); set_new_checkbox_theme(buf, enabled, disabled); - buf->info_label = - create_utf8_from_char(nation_adjective_for_player(pplayer), - adj_font(12)); + buf->info_label + = create_utf8_from_char_fonto(nation_adjective_for_player(pplayer), + FONTO_ATTENTION); buf->info_label->style &= ~SF_CENTER; set_wstate(buf, FC_WS_NORMAL); diff --git a/client/gui-sdl2/gui_string.c b/client/gui-sdl2/gui_string.c index 339fae58f8..2b543d5130 100644 --- a/client/gui-sdl2/gui_string.c +++ b/client/gui-sdl2/gui_string.c @@ -160,10 +160,15 @@ void utf8_str_size(utf8_str *pstr, SDL_Rect *fill) **************************************************************************/ static Uint16 fonto_ptsize(enum font_origin origin) { + int def; + switch (origin) { case FONTO_DEFAULT: /* Rely on create_utf8_str() default */ return 0; + case FONTO_ATTENTION: + def = ptsize_default(); + return adj_font(MAX(def + 1, def * 1.2)); } return 0; diff --git a/client/gui-sdl2/gui_string.h b/client/gui-sdl2/gui_string.h index 1ffadadfb5..2c795172a3 100644 --- a/client/gui-sdl2/gui_string.h +++ b/client/gui-sdl2/gui_string.h @@ -61,7 +61,8 @@ typedef struct utf8_str { } utf8_str; enum font_origin { - FONTO_DEFAULT + FONTO_DEFAULT, + FONTO_ATTENTION }; utf8_str *create_utf8_str_fonto(char *in_text, size_t n_alloc, diff --git a/client/gui-sdl2/helpdlg.c b/client/gui-sdl2/helpdlg.c index 319d46b2aa..4e94a50272 100644 --- a/client/gui-sdl2/helpdlg.c +++ b/client/gui-sdl2/helpdlg.c @@ -243,7 +243,8 @@ void popup_impr_info(Impr_type_id impr) store = fc_calloc(1, sizeof(struct units_buttons)); /* Create window */ - title = create_utf8_from_char(_("Help : Improvements"), adj_font(12)); + title = create_utf8_from_char_fonto(_("Help : Improvements"), + FONTO_ATTENTION); title->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, title, WF_FREE_DATA); @@ -258,11 +259,13 @@ void popup_impr_info(Impr_type_id impr) /* ------------------ */ /* Close button */ - close_button = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, + close_button = create_themeicon(current_theme->small_cancel_icon, + pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - close_button->info_label = - create_utf8_from_char(_("Close Dialog (Esc)"), adj_font(12)); + close_button->info_label + = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); close_button->action = exit_help_dlg_callback; set_wstate(close_button, FC_WS_NORMAL); close_button->key = SDLK_ESCAPE; @@ -381,16 +384,18 @@ void popup_impr_info(Impr_type_id impr) if (!is_convert_improvement(pimpr_type)) { sprintf(buffer, "%s %d", _("Base Cost:"), impr_base_build_shield_cost(pimpr_type)); - cost_label = create_iconlabel_from_chars(NULL, pwindow->dst, - buffer, adj_font(12), 0); + cost_label = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + buffer, + FONTO_ATTENTION, 0); cost_label->id = ID_LABEL; widget_add_as_prev(cost_label, dock); dock = cost_label; if (!is_wonder(pimpr_type)) { sprintf(buffer, "%s %d", _("Upkeep:"), pimpr_type->upkeep); - upkeep_label = create_iconlabel_from_chars(NULL, pwindow->dst, - buffer, adj_font(12), 0); + upkeep_label = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + buffer, + FONTO_ATTENTION, 0); upkeep_label->id = ID_LABEL; widget_add_as_prev(upkeep_label, dock); dock = upkeep_label; @@ -398,9 +403,9 @@ void popup_impr_info(Impr_type_id impr) } /* Requirement */ - requirement_label = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Requirement:"), - adj_font(12), 0); + requirement_label = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Requirement:"), + FONTO_ATTENTION, 0); requirement_label->id = ID_LABEL; widget_add_as_prev(requirement_label, dock); dock = requirement_label; @@ -413,9 +418,11 @@ void popup_impr_info(Impr_type_id impr) if (!preq->present) { continue; } - requirement_label2 = create_iconlabel_from_chars(NULL, pwindow->dst, + requirement_label2 + = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, universal_name_translation(&preq->source, buffer, sizeof(buffer)), - adj_font(12), WF_RESTORE_BACKGROUND); + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); if (preq->source.kind != VUT_ADVANCE) { break; /* FIXME */ } @@ -428,9 +435,9 @@ void popup_impr_info(Impr_type_id impr) } requirement_vector_iterate_end; if (requirement_label2 == NULL) { - requirement_label2 = create_iconlabel_from_chars(NULL, pwindow->dst, - Q_("?req:None"), - adj_font(12), 0); + requirement_label2 = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + Q_("?req:None"), + FONTO_ATTENTION, 0); requirement_label2->id = ID_LABEL; } @@ -439,9 +446,9 @@ void popup_impr_info(Impr_type_id impr) store->requirement_button = requirement_label2; /* Obsolete by */ - obsolete_by_label = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Obsolete by:"), - adj_font(12), 0); + obsolete_by_label = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Obsolete by:"), + FONTO_ATTENTION, 0); obsolete_by_label->id = ID_LABEL; widget_add_as_prev(obsolete_by_label, dock); dock = obsolete_by_label; @@ -454,15 +461,19 @@ void popup_impr_info(Impr_type_id impr) } requirement_vector_iterate_end; if (obsTech == NULL) { - obsolete_by_label2 = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Never"), adj_font(12), 0); + obsolete_by_label2 = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Never"), + FONTO_ATTENTION, 0); obsolete_by_label2->id = ID_LABEL; } else { - obsolete_by_label2 = create_iconlabel_from_chars(NULL, pwindow->dst, - advance_name_translation(obsTech), - adj_font(12), WF_RESTORE_BACKGROUND); + obsolete_by_label2 + = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + advance_name_translation(obsTech), + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); obsolete_by_label2->id = MAX_ID - advance_number(obsTech); - obsolete_by_label2->string_utf8->fgcol = *get_tech_color(advance_number(obsTech)); + obsolete_by_label2->string_utf8->fgcol + = *get_tech_color(advance_number(obsTech)); obsolete_by_label2->action = change_tech_callback; set_wstate(obsolete_by_label2, FC_WS_NORMAL); } @@ -477,7 +488,7 @@ void popup_impr_info(Impr_type_id impr) helptext_building(buffer, sizeof(buffer), client.conn.playing, NULL, pimpr_type); if (buffer[0] != '\0') { - utf8_str *bstr = create_utf8_from_char(buffer, adj_font(12)); + utf8_str *bstr = create_utf8_from_char_fonto(buffer, FONTO_ATTENTION); convert_utf8_str_to_const_surface_width(bstr, adj_size(640) - start_x - adj_size(20)); help_text_label = create_iconlabel(NULL, pwindow->dst, bstr, 0); @@ -647,7 +658,7 @@ void popup_unit_info(Unit_type_id type_id) popdown_help_dialog(); } - /* create new dialog if it doesn't exist yet */ + /* Create new dialog if it doesn't exist yet */ if (!help_dlg) { SDL_Surface *background_tmpl, *background, *unit_name, *icon; SDL_Rect dst; @@ -655,12 +666,12 @@ void popup_unit_info(Unit_type_id type_id) current_help_dlg = HELP_UNIT; created = TRUE; - /* create dialog */ + /* Create dialog */ help_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); store = fc_calloc(1, sizeof(struct units_buttons)); - /* create window */ - title = create_utf8_from_char(_("Help : Units"), adj_font(12)); + /* Create window */ + title = create_utf8_from_char_fonto(_("Help : Units"), FONTO_ATTENTION); title->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, title, WF_FREE_DATA); @@ -675,12 +686,13 @@ void popup_unit_info(Unit_type_id type_id) /* ------------------ */ - /* close button */ - close_button = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, + /* Close button */ + close_button = create_themeicon(current_theme->small_cancel_icon, + pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - close_button->info_label = - create_utf8_from_char(_("Close Dialog (Esc)"), adj_font(12)); + close_button->info_label + = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), FONTO_ATTENTION); close_button->action = exit_help_dlg_callback; set_wstate(close_button, FC_WS_NORMAL); close_button->key = SDLK_ESCAPE; @@ -840,17 +852,17 @@ void popup_unit_info(Unit_type_id type_id) _("Firepower:"), punittype->firepower, _("Hitpoints:"), punittype->hp); - unit_info_label = create_iconlabel_from_chars(NULL, pwindow->dst, buf, - adj_font(12), 0); + unit_info_label = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, buf, + FONTO_ATTENTION, 0); unit_info_label->id = ID_LABEL; widget_add_as_prev(unit_info_label, dock); dock = unit_info_label; } /* Requirement */ - requirement_label = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Requirement:"), - adj_font(12), 0); + requirement_label = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Requirement:"), + FONTO_ATTENTION, 0); requirement_label->id = ID_LABEL; widget_add_as_prev(requirement_label, dock); dock = requirement_label; @@ -858,17 +870,18 @@ void popup_unit_info(Unit_type_id type_id) req = utype_primary_tech_req(punittype); if (advance_number(req) == A_NONE) { - requirement_label2 = create_iconlabel_from_chars(NULL, pwindow->dst, - Q_("?tech:None"), - adj_font(12), 0); + requirement_label2 = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + Q_("?tech:None"), + FONTO_ATTENTION, 0); requirement_label2->id = ID_LABEL; } else { Tech_type_id req_id = advance_number(req); - requirement_label2 = create_iconlabel_from_chars(NULL, pwindow->dst, - advance_name_translation(req), - adj_font(12), - WF_RESTORE_BACKGROUND); + requirement_label2 + = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + advance_name_translation(req), + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); requirement_label2->id = MAX_ID - req_id; requirement_label2->string_utf8->fgcol = *get_tech_color(req_id); requirement_label2->action = change_tech_callback; @@ -879,27 +892,29 @@ void popup_unit_info(Unit_type_id type_id) store->requirement_button = requirement_label2; /* Obsolete by */ - obsolete_by_label = create_iconlabel_from_chars(NULL, pwindow->dst, - _("Obsolete by:"), - adj_font(12), 0); + obsolete_by_label = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + _("Obsolete by:"), + FONTO_ATTENTION, 0); obsolete_by_label->id = ID_LABEL; widget_add_as_prev(obsolete_by_label, dock); dock = obsolete_by_label; if (punittype->obsoleted_by == U_NOT_OBSOLETED) { - obsolete_by_label2 = create_iconlabel_from_chars(NULL, pwindow->dst, - Q_("?utype:None"), - adj_font(12), 0); + obsolete_by_label2 = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + Q_("?utype:None"), + FONTO_ATTENTION, 0); obsolete_by_label2->id = ID_LABEL; } else { const struct unit_type *utype = punittype->obsoleted_by; struct advance *obs_req = utype_primary_tech_req(utype); - obsolete_by_label2 = create_iconlabel_from_chars(NULL, pwindow->dst, - utype_name_translation(utype), - adj_font(12), - WF_RESTORE_BACKGROUND); - obsolete_by_label2->string_utf8->fgcol = *get_tech_color(advance_number(obs_req)); + obsolete_by_label2 + = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + utype_name_translation(utype), + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); + obsolete_by_label2->string_utf8->fgcol + = *get_tech_color(advance_number(obs_req)); obsolete_by_label2->id = MAX_ID - utype_number(utype); obsolete_by_label2->action = change_unit_callback; set_wstate(obsolete_by_label2, FC_WS_NORMAL); @@ -914,7 +929,7 @@ void popup_unit_info(Unit_type_id type_id) buffer[0] = '\0'; helptext_unit(buffer, sizeof(buffer), client.conn.playing, "", utype_by_number(type_id)); if (buffer[0] != '\0') { - utf8_str *ustr = create_utf8_from_char(buffer, adj_font(12)); + utf8_str *ustr = create_utf8_from_char_fonto(buffer, FONTO_ATTENTION); convert_utf8_str_to_const_surface_width(ustr, adj_size(640) - start_x - adj_size(20)); help_text_label = create_iconlabel(NULL, pwindow->dst, ustr, 0); @@ -1080,7 +1095,7 @@ static void redraw_tech_info_dlg(void) if (store->sub_targets[0]) { int i; - change_ptsize_utf8(pstr, adj_font(12)); + change_fonto_utf8(pstr, FONTO_ATTENTION); copy_chars_to_utf8_str(pstr, _("( with ")); text0 = create_text_surf_from_utf8(pstr); @@ -1153,10 +1168,11 @@ static struct widget *create_tech_info(Tech_type_id tech, int width, if ((targets_count < 6) && (advance_required(aidx, AR_ONE) == tech || advance_required(aidx, AR_TWO) == tech)) { - pwidget = create_iconlabel_from_chars(NULL, pwindow->dst, - advance_name_translation(advance_by_number(aidx)), - adj_font(12), - WF_RESTORE_BACKGROUND); + pwidget + = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, + advance_name_translation(advance_by_number(aidx)), + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); pwidget->string_utf8->fgcol = *get_tech_color(aidx); max_width = MAX(max_width, pwidget->size.w); set_wstate(pwidget, FC_WS_NORMAL); @@ -1186,10 +1202,11 @@ static struct widget *create_tech_info(Tech_type_id tech, int width, } else { continue; } - pwidget = create_iconlabel_from_chars(NULL, pwindow->dst, + pwidget + = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, advance_name_translation(advance_by_number(sub_tech)), - adj_font(12), - WF_RESTORE_BACKGROUND); + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); pwidget->string_utf8->fgcol = *get_tech_color(sub_tech); set_wstate(pwidget, FC_WS_NORMAL); pwidget->action = change_tech_callback; @@ -1284,7 +1301,7 @@ static struct widget *create_tech_info(Tech_type_id tech, int width, helptext_advance(buffer, sizeof(buffer), client.conn.playing, "", tech); } if (buffer[0] != '\0') { - utf8_str *pstr = create_utf8_from_char(buffer, adj_font(12)); + utf8_str *pstr = create_utf8_from_char_fonto(buffer, FONTO_ATTENTION); convert_utf8_str_to_const_surface_width(pstr, adj_size(640) - start_x - adj_size(20)); pwidget = create_iconlabel(NULL, pwindow->dst, pstr, 0); @@ -1927,13 +1944,14 @@ void popup_tech_info(Tech_type_id tech) store->show_full_tree = FALSE; /* Create window */ - title = create_utf8_from_char(_("Help : Advances Tree"), adj_font(12)); + title = create_utf8_from_char_fonto(_("Help : Advances Tree"), + FONTO_ATTENTION); title->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, title, WF_FREE_DATA); pwindow->data.ptr = (void *)store; pwindow->action = help_dlg_window_callback; - set_wstate(pwindow , FC_WS_NORMAL); + set_wstate(pwindow, FC_WS_NORMAL); add_to_gui_list(ID_WINDOW, pwindow); @@ -1945,8 +1963,8 @@ void popup_tech_info(Tech_type_id tech) close_button = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - close_button->info_label = - create_utf8_from_char(_("Close Dialog (Esc)"), adj_font(12)); + close_button->info_label + = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), FONTO_ATTENTION); close_button->action = exit_help_dlg_callback; set_wstate(close_button, FC_WS_NORMAL); close_button->key = SDLK_ESCAPE; diff --git a/client/gui-sdl2/inteldlg.c b/client/gui-sdl2/inteldlg.c index b38e861068..cf1b2d3f0a 100644 --- a/client/gui-sdl2/inteldlg.c +++ b/client/gui-sdl2/inteldlg.c @@ -249,7 +249,8 @@ void update_intel_dialog(struct player *p) pdialog->pdialog->end_widget_list); } - pstr = create_utf8_from_char(_("Foreign Intelligence Report") , adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Foreign Intelligence Report"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -264,12 +265,12 @@ void update_intel_dialog(struct player *p) area = pwindow->area; /* ---------- */ - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w = MAX(area.w, buf->size.w + adj_size(10)); buf->action = exit_intel_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -298,7 +299,7 @@ void update_intel_dialog(struct player *p) fc_snprintf(cbuf, sizeof(cbuf), _("Intelligence Information about the %s Spaceship"), nation_adjective_for_player(p)); - buf->info_label = create_utf8_from_char(cbuf, adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); add_to_gui_list(ID_ICON, buf); @@ -398,9 +399,10 @@ void update_intel_dialog(struct player *p) buf->action = tech_callback; set_wstate(buf, FC_WS_NORMAL); - buf->info_label = - create_utf8_from_char(advance_name_translation - (advance_by_number(i)), adj_font(12)); + buf->info_label + = create_utf8_from_char_fonto(advance_name_translation + (advance_by_number(i)), + FONTO_ATTENTION); add_to_gui_list(ID_ICON, buf); diff --git a/client/gui-sdl2/mapctrl.c b/client/gui-sdl2/mapctrl.c index 3c8c589852..a9f62edd22 100644 --- a/client/gui-sdl2/mapctrl.c +++ b/client/gui-sdl2/mapctrl.c @@ -722,8 +722,8 @@ static void popup_minimap_scale_dialog(void) scale_minimap_dlg = fc_calloc(1, sizeof(struct small_dialog)); - /* create window */ - pstr = create_utf8_from_char(_("Scale Mini Map"), adj_font(12)); + /* Create window */ + pstr = create_utf8_from_char_fonto(_("Scale Mini Map"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); pwindow->action = move_scale_minimap_dlg_callback; @@ -734,7 +734,7 @@ static void popup_minimap_scale_dialog(void) area = pwindow->area; /* ----------------- */ - pstr = create_utf8_from_char(_("Single Tile Width"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Single Tile Width"), FONTO_ATTENTION); text1 = create_text_surf_from_utf8(pstr); area.w = MAX(area.w, text1->w + adj_size(30)); @@ -786,7 +786,7 @@ static void popup_minimap_scale_dialog(void) area.w = MAX(area.w , buf->size.w * 2 + buf->next->size.w + adj_size(20)); /* ------------ */ - pstr = create_utf8_from_char(_("Exit"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Exit"), FONTO_ATTENTION); buf = create_themeicon_button(current_theme->cancel_icon, pwindow->dst, pstr, 0); buf->action = popdown_scale_minimap_dlg_callback; @@ -1113,8 +1113,8 @@ static void popup_unitinfo_scale_dialog(void) scale_unit_info_dlg = fc_calloc(1, sizeof(struct small_dialog)); - /* create window */ - pstr = create_utf8_from_char(_("Scale Unit Info"), adj_font(12)); + /* Create window */ + pstr = create_utf8_from_char_fonto(_("Scale Unit Info"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); pwindow->action = move_scale_unitinfo_dlg_callback; @@ -1124,7 +1124,7 @@ static void popup_unitinfo_scale_dialog(void) area = pwindow->area; - pstr = create_utf8_from_char(_("Width"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Width"), FONTO_ATTENTION); text1 = create_text_surf_from_utf8(pstr); area.w = MAX(area.w, text1->w + adj_size(30)); area.h += MAX(adj_size(20), text1->h + adj_size(4)); @@ -1164,7 +1164,7 @@ static void popup_unitinfo_scale_dialog(void) area.w = MAX(area.w , buf->size.w * 2 + adj_size(20)); /* ------------ */ - pstr = create_utf8_from_char(_("Exit"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Exit"), FONTO_ATTENTION); buf = create_themeicon_button(current_theme->cancel_icon, pwindow->dst, pstr, 0); buf->action = popdown_scale_unitinfo_dlg_callback; @@ -1489,13 +1489,13 @@ void popup_unitinfo_window(void) unit_info_dlg->end_widget_list = units_info_window; units_info_window->private_data.adv_dlg = unit_info_dlg; - /* economy button */ + /* Economy button */ pwidget = create_icon2(get_tax_surface(O_GOLD), units_info_window->dst, WF_FREE_GFX | WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND | WF_FREE_THEME); fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Economy"), "F5"); - pwidget->info_label = create_utf8_from_char(buf, adj_font(12)); + pwidget->info_label = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); pwidget->action = economy_callback; pwidget->key = SDLK_F5; @@ -1510,7 +1510,7 @@ void popup_unitinfo_window(void) | WF_RESTORE_BACKGROUND | WF_FREE_THEME); /* TRANS: Research report action */ fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Research"), "F6"); - pwidget->info_label = create_utf8_from_char(buf, adj_font(12)); + pwidget->info_label = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); pwidget->action = research_callback; pwidget->key = SDLK_F6; @@ -1524,7 +1524,7 @@ void popup_unitinfo_window(void) WF_FREE_GFX | WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND | WF_FREE_THEME); fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Revolution"), "Ctrl+Shift+G"); - pwidget->info_label = create_utf8_from_char(buf, adj_font(12)); + pwidget->info_label = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); pwidget->action = revolution_callback; pwidget->key = SDLK_g; pwidget->mod = KMOD_CTRL | KMOD_SHIFT; @@ -1545,8 +1545,9 @@ void popup_unitinfo_window(void) WF_FREE_GFX | WF_FREE_THEME | WF_RESTORE_BACKGROUND | WF_WIDGET_HAS_INFO_LABEL); - pwidget->info_label = create_utf8_from_char(_("Hide Unit Info Window"), - adj_font(12)); + pwidget->info_label + = create_utf8_from_char_fonto(_("Hide Unit Info Window"), + FONTO_ATTENTION); pwidget->action = toggle_unit_info_window_callback; @@ -1681,12 +1682,12 @@ void popup_minimap_window(void) minimap_window = pwindow; minimap_dlg->end_widget_list = minimap_window; - /* new turn button */ + /* New turn button */ pwidget = create_themeicon(current_theme->new_turn_icon, minimap_window->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Turn Done"), _("Shift+Return")); - pwidget->info_label = create_utf8_from_char(buf, adj_font(12)); + pwidget->info_label = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); pwidget->action = end_turn_callback; pwidget->key = SDLK_RETURN; pwidget->mod = KMOD_SHIFT; @@ -1701,19 +1702,19 @@ void popup_minimap_window(void) | WF_RESTORE_BACKGROUND); /* TRANS: Nations report action */ fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Nations"), "F3"); - pwidget->info_label = create_utf8_from_char(buf, adj_font(12)); + pwidget->info_label = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); pwidget->action = players_action_callback; pwidget->key = SDLK_F3; add_to_gui_list(ID_PLAYERS, pwidget); - /* find city button */ + /* Find city button */ pwidget = create_themeicon(current_theme->find_city_icon, minimap_window->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); fc_snprintf(buf, sizeof(buf), "%s (%s)\n%s\n%s (%s)", _("Cities Report"), "F4", _("or"), _("Find City"), "Ctrl+F"); - pwidget->info_label = create_utf8_from_char(buf, adj_font(12)); + pwidget->info_label = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); pwidget->info_label->style |= SF_CENTER; pwidget->action = cities_action_callback; pwidget->key = SDLK_f; @@ -1723,36 +1724,37 @@ void popup_minimap_window(void) find_city_button = pwidget; - /* units button */ + /* Units button */ pwidget = create_themeicon(current_theme->units2_icon, minimap_window->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Units"), "F2"); - pwidget->info_label = create_utf8_from_char(buf, adj_font(12)); + pwidget->info_label = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); pwidget->action = units_action_callback; pwidget->key = SDLK_F2; add_to_gui_list(ID_UNITS, pwidget); - /* show/hide log window button */ + /* Show/hide log window button */ pwidget = create_themeicon(current_theme->log_icon, minimap_window->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Hide Messages"), "F9"); - pwidget->info_label = create_utf8_from_char(buf, adj_font(12)); + pwidget->info_label = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); pwidget->action = toggle_msg_window_callback; pwidget->key = SDLK_F9; add_to_gui_list(ID_CHATLINE_TOGGLE_LOG_WINDOW_BUTTON, pwidget); #ifdef SMALL_SCREEN - /* options button */ + /* Options button */ options_button = create_themeicon(current_theme->options_icon, minimap_window->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Options"), "Esc"); - options_button->info_label = create_utf8_from_char(buf, adj_font(12)); + options_button->info_label + = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); options_button->action = optiondlg_callback; options_button->key = SDLK_ESCAPE; @@ -1774,8 +1776,8 @@ void popup_minimap_window(void) WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pwidget->info_label = create_utf8_from_char(_("Hide Mini Map"), - adj_font(12)); + pwidget->info_label = create_utf8_from_char_fonto(_("Hide Mini Map"), + FONTO_ATTENTION); pwidget->action = toggle_map_window_callback; add_to_gui_list(ID_TOGGLE_MAP_WINDOW_BUTTON, pwidget); @@ -2775,9 +2777,9 @@ void popup_newcity_dialog(struct unit *punit, const char *suggest_name) new_city_dlg = fc_calloc(1, sizeof(struct small_dialog)); - /* create window */ - pstr = create_utf8_from_char(action_id_name_translation(ACTION_FOUND_CITY), - adj_font(12)); + /* Create window */ + pstr = create_utf8_from_char_fonto(action_id_name_translation(ACTION_FOUND_CITY), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); pwindow->action = move_new_city_dlg_callback; @@ -2819,7 +2821,7 @@ void popup_newcity_dialog(struct unit *punit, const char *suggest_name) area.h += label->size.h; pedit = create_edit(NULL, pwindow->dst, - create_utf8_from_char(suggest_name, adj_font(12)), + create_utf8_from_char_fonto(suggest_name, FONTO_ATTENTION), (ok_button->size.w + cancel_button->size.w + adj_size(15)), WF_RESTORE_BACKGROUND); pedit->action = newcity_name_edit_callback; @@ -2836,7 +2838,7 @@ void popup_newcity_dialog(struct unit *punit, const char *suggest_name) pedit->size.w = area.w - adj_size(20); - /* create window background */ + /* Create window background */ background = theme_get_background(active_theme, BACKGROUND_NEWCITYDLG); if (resize_window(pwindow, background, NULL, (pwindow->size.w - pwindow->area.w) + area.w, diff --git a/client/gui-sdl2/mapview.c b/client/gui-sdl2/mapview.c index 5b4f11afb7..8e3317a29f 100644 --- a/client/gui-sdl2/mapview.c +++ b/client/gui-sdl2/mapview.c @@ -537,7 +537,7 @@ void redraw_unit_info_label(struct unit_list *punitlist) if (sdl2_client_flags & CF_UNITINFO_SHOWN) { info_window = get_unit_info_window_widget(); - /* blit theme surface */ + /* Blit theme surface */ widget_redraw(info_window); if (punit) { @@ -549,7 +549,8 @@ void redraw_unit_info_label(struct unit_list *punitlist) const char *vetname; /* Get and draw unit name (with veteran status) */ - pstr = create_utf8_from_char(unit_name_translation(punit), adj_font(12)); + pstr = create_utf8_from_char_fonto(unit_name_translation(punit), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pstr->bgcol = (SDL_Color) {0, 0, 0, 0}; name = create_text_surf_from_utf8(pstr); diff --git a/client/gui-sdl2/messagewin.c b/client/gui-sdl2/messagewin.c index 6dcaea7316..9ccdf04e2e 100644 --- a/client/gui-sdl2/messagewin.c +++ b/client/gui-sdl2/messagewin.c @@ -253,8 +253,8 @@ void meswin_dialog_popup(bool raise) msg_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); - /* create window */ - pstr = create_utf8_from_char(_("Messages"), adj_font(12)); + /* Create window */ + pstr = create_utf8_from_char_fonto(_("Messages"), FONTO_ATTENTION); pstr->style = TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); diff --git a/client/gui-sdl2/optiondlg.c b/client/gui-sdl2/optiondlg.c index f8fa0aed83..4754a4b3af 100644 --- a/client/gui-sdl2/optiondlg.c +++ b/client/gui-sdl2/optiondlg.c @@ -511,12 +511,13 @@ static struct widget *option_widget_new(struct option *poption, help_text = fc_strdup(option_help_text(poption)); fc_break_lines(help_text, 50); - widget = create_iconlabel_from_chars(NULL, window->dst, - option_description(poption), - adj_font(12), - flags | WF_WIDGET_HAS_INFO_LABEL); + widget = create_iconlabel_from_chars_fonto(NULL, window->dst, + option_description(poption), + FONTO_ATTENTION, + flags | WF_WIDGET_HAS_INFO_LABEL); widget->string_utf8->style |= TTF_STYLE_BOLD; - widget->info_label = create_utf8_from_char(help_text, adj_font(12)); + widget->info_label = create_utf8_from_char_fonto(help_text, + FONTO_ATTENTION); widget->action = none_callback; set_wstate(widget, FC_WS_NORMAL); remake_label_size(widget); @@ -534,9 +535,10 @@ static struct widget *option_widget_new(struct option *poption, char buf[64]; fc_snprintf(buf, sizeof(buf), "%d", option_int_get(poption)); - widget = create_edit_from_chars(NULL, window->dst, buf, adj_font(12), - adj_size(25), - flags | WF_WIDGET_HAS_INFO_LABEL); + widget = create_edit_from_chars_fonto(NULL, window->dst, buf, + FONTO_ATTENTION, + adj_size(25), + flags | WF_WIDGET_HAS_INFO_LABEL); } break; @@ -545,15 +547,17 @@ static struct widget *option_widget_new(struct option *poption, const struct strvec *values = option_str_values(poption); if (NULL != values) { - widget = combo_new_from_chars(NULL, window->dst, adj_font(12), - option_str_get(poption), values, - adj_size(25), - flags | WF_WIDGET_HAS_INFO_LABEL); + widget = combo_new_from_chars_fonto(NULL, window->dst, + FONTO_ATTENTION, + option_str_get(poption), values, + adj_size(25), + flags | WF_WIDGET_HAS_INFO_LABEL); } else { - widget = create_edit_from_chars(NULL, window->dst, - option_str_get(poption), - adj_font(12), adj_size(25), - flags | WF_WIDGET_HAS_INFO_LABEL); + widget = create_edit_from_chars_fonto(NULL, window->dst, + option_str_get(poption), + FONTO_ATTENTION, + adj_size(25), + flags | WF_WIDGET_HAS_INFO_LABEL); } } break; @@ -569,10 +573,11 @@ static struct widget *option_widget_new(struct option *poption, strvec_set(translated_values, i, _(strvec_get(values, i))); } - widget = combo_new_from_chars(NULL, window->dst, adj_font(12), - _(option_enum_get_str(poption)), - translated_values, adj_size(25), - flags | WF_WIDGET_HAS_INFO_LABEL); + widget = combo_new_from_chars_fonto(NULL, window->dst, + FONTO_ATTENTION, + _(option_enum_get_str(poption)), + translated_values, adj_size(25), + flags | WF_WIDGET_HAS_INFO_LABEL); widget->destroy = enum_widget_destroy; } break; @@ -588,19 +593,21 @@ static struct widget *option_widget_new(struct option *poption, fc_assert(video_mode_to_string(buf, sizeof(buf), &vmod)); } - widget = combo_new_from_chars(NULL, window->dst, adj_font(12), - buf, video_mode_list(), adj_size(25), - flags | WF_WIDGET_HAS_INFO_LABEL); + widget = combo_new_from_chars_fonto(NULL, window->dst, + FONTO_ATTENTION, + buf, video_mode_list(), adj_size(25), + flags | WF_WIDGET_HAS_INFO_LABEL); widget->destroy = video_mode_widget_destroy; } break; case OT_FONT: { - widget = create_edit_from_chars(NULL, window->dst, - option_font_get(poption), - adj_font(12), adj_size(25), - flags | WF_WIDGET_HAS_INFO_LABEL); + widget = create_edit_from_chars_fonto(NULL, window->dst, + option_font_get(poption), + FONTO_ATTENTION, + adj_size(25), + flags | WF_WIDGET_HAS_INFO_LABEL); } break; @@ -614,10 +621,11 @@ static struct widget *option_widget_new(struct option *poption, if (NULL == widget) { /* Not implemented. */ - widget = create_iconlabel_from_chars(NULL, window->dst, "", - adj_font(12), flags); + widget = create_iconlabel_from_chars_fonto(NULL, window->dst, "", + FONTO_ATTENTION, flags); } else { - widget->info_label = create_utf8_from_char(help_text, adj_font(12)); + widget->info_label = create_utf8_from_char_fonto(help_text, + FONTO_ATTENTION); widget->action = none_callback; if (option_is_changeable(poption)) { set_wstate(widget, FC_WS_NORMAL); @@ -786,7 +794,7 @@ static struct option_dialog *option_dialog_new(void) pdialog->mode = ODM_MAIN; /* Create window widget. */ - str = create_utf8_from_char(_("Options"), adj_font(12)); + str = create_utf8_from_char_fonto(_("Options"), FONTO_ATTENTION); str->style |= TTF_STYLE_BOLD; window = create_window_skeleton(NULL, str, 0); @@ -797,11 +805,12 @@ static struct option_dialog *option_dialog_new(void) pdialog->end_widget_list = window; /* Create close button widget. */ - close_button = create_themeicon(current_theme->small_cancel_icon, window->dst, + close_button = create_themeicon(current_theme->small_cancel_icon, + window->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - close_button->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + close_button->info_label + = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), FONTO_ATTENTION); close_button->action = back_callback; set_wstate(close_button, FC_WS_NORMAL); close_button->key = SDLK_ESCAPE; @@ -809,18 +818,18 @@ static struct option_dialog *option_dialog_new(void) pdialog->core_widget_list = close_button; /* Create client options button widget. */ - widget = create_icon_button_from_chars(NULL, window->dst, - _("Local options"), - adj_font(12), 0); + widget = create_icon_button_from_chars_fonto(NULL, window->dst, + _("Local options"), + FONTO_ATTENTION, 0); widget->action = client_options_callback; set_wstate(widget, FC_WS_NORMAL); widget_resize(widget, widget->size.w, widget->size.h + adj_size(4)); add_to_gui_list(ID_OPTIONS_CLIENT_BUTTON, widget); /* Create server options button widget. */ - widget = create_icon_button_from_chars(NULL, window->dst, - _("Server options"), - adj_font(12), 0); + widget = create_icon_button_from_chars_fonto(NULL, window->dst, + _("Server options"), + FONTO_ATTENTION, 0); widget->action = server_options_callback; if (client.conn.established) { set_wstate(widget, FC_WS_NORMAL); @@ -829,8 +838,9 @@ static struct option_dialog *option_dialog_new(void) add_to_gui_list(ID_OPTIONS_SERVER_BUTTON, widget); /* Create global worklists button widget. */ - widget = create_icon_button_from_chars(NULL, window->dst, - _("Worklists"), adj_font(12), 0); + widget = create_icon_button_from_chars_fonto(NULL, window->dst, + _("Worklists"), + FONTO_ATTENTION, 0); widget->action = work_lists_callback; if (C_S_RUNNING == client_state()) { set_wstate(widget, FC_WS_NORMAL); @@ -839,17 +849,18 @@ static struct option_dialog *option_dialog_new(void) add_to_gui_list(ID_OPTIONS_WORKLIST_BUTTON, widget); /* Create save game button widget. */ - widget = create_icon_button_from_chars(NULL, window->dst, - _("Save Local Options"), - adj_font(12), 0); + widget = create_icon_button_from_chars_fonto(NULL, window->dst, + _("Save Local Options"), + FONTO_ATTENTION, 0); widget->action = save_client_options_callback; set_wstate(widget, FC_WS_NORMAL); widget_resize(widget, widget->size.w, widget->size.h + adj_size(4)); add_to_gui_list(ID_OPTIONS_SAVE_BUTTON, widget); /* Create save game button widget. */ - widget = create_icon_button_from_chars(NULL, window->dst, - _("Save Game"), adj_font(12), 0); + widget = create_icon_button_from_chars_fonto(NULL, window->dst, + _("Save Game"), + FONTO_ATTENTION, 0); widget->action = save_game_callback; if (C_S_RUNNING == client_state()) { set_wstate(widget, FC_WS_NORMAL); @@ -858,8 +869,9 @@ static struct option_dialog *option_dialog_new(void) add_to_gui_list(ID_OPTIONS_SAVE_GAME_BUTTON, widget); /* Create help browser button widget. */ - widget = create_icon_button_from_chars(NULL, window->dst, - _("Help Browser"), adj_font(12), 0); + widget = create_icon_button_from_chars_fonto(NULL, window->dst, + _("Help Browser"), + FONTO_ATTENTION, 0); widget->action = help_browser_callback; widget->key = SDLK_h; if (client.conn.established) { @@ -869,8 +881,9 @@ static struct option_dialog *option_dialog_new(void) add_to_gui_list(ID_OPTIONS_HELP_BROWSER_BUTTON, widget); /* Create leave game button widget. */ - widget = create_icon_button_from_chars(NULL, window->dst, - _("Leave Game"), adj_font(12), 0); + widget = create_icon_button_from_chars_fonto(NULL, window->dst, + _("Leave Game"), + FONTO_ATTENTION, 0); widget->action = disconnect_callback; widget->key = SDLK_q; if (client.conn.established) { @@ -880,8 +893,9 @@ static struct option_dialog *option_dialog_new(void) add_to_gui_list(ID_OPTIONS_DISC_BUTTON, widget); /* Create quit widget button. */ - widget = create_icon_button_from_chars(NULL, window->dst, - _("Quit"), adj_font(12), 0); + widget = create_icon_button_from_chars_fonto(NULL, window->dst, + _("Quit"), + FONTO_ATTENTION, 0); widget->action = exit_callback; widget->key = SDLK_q; set_wstate(widget, FC_WS_NORMAL); @@ -975,9 +989,9 @@ static void option_dialog_optset(struct option_dialog *pdialog, continue; } - widget = create_icon_button_from_chars(NULL, window->dst, - optset_category_name(poptset, i), - adj_font(12), 0); + widget = create_icon_button_from_chars_fonto(NULL, window->dst, + optset_category_name(poptset, i), + FONTO_ATTENTION, 0); widget->action = option_category_callback; set_wstate(widget, FC_WS_NORMAL); widget_resize(widget, widget->size.w, widget->size.h + adj_size(4)); @@ -1021,8 +1035,8 @@ static void option_dialog_optset_category(struct option_dialog *pdialog, apply_button = create_themeicon(current_theme->small_ok_icon, window->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - apply_button->info_label = create_utf8_from_char(_("Apply changes"), - adj_font(12)); + apply_button->info_label = create_utf8_from_char_fonto(_("Apply changes"), + FONTO_ATTENTION); apply_button->action = apply_callback; set_wstate(apply_button, FC_WS_NORMAL); add_to_gui_list(ID_OPTIONS_APPLY_BUTTON, apply_button); @@ -1147,10 +1161,11 @@ static int add_new_worklist_callback(struct widget *widget) selected_widget = NULL; /* Create list element. */ - new_worklist_widget = - create_iconlabel_from_chars(NULL, widget->dst, - global_worklist_name(pgwl), - adj_font(12), WF_RESTORE_BACKGROUND); + new_worklist_widget + = create_iconlabel_from_chars_fonto(NULL, widget->dst, + global_worklist_name(pgwl), + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); new_worklist_widget->id = MAX_ID - global_worklist_id(pgwl); new_worklist_widget->string_utf8->style |= SF_CENTER; set_wstate(new_worklist_widget, FC_WS_NORMAL); @@ -1225,10 +1240,10 @@ static void option_dialog_worklist(struct option_dialog *pdialog) /* Build the global worklists list. */ global_worklists_iterate(pgwl) { - widget = create_iconlabel_from_chars(NULL, window->dst, - global_worklist_name(pgwl), - adj_font(12), - WF_RESTORE_BACKGROUND); + widget = create_iconlabel_from_chars_fonto(NULL, window->dst, + global_worklist_name(pgwl), + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); set_wstate(widget, FC_WS_NORMAL); add_to_gui_list(MAX_ID - global_worklist_id(pgwl), widget); widget->action = edit_worklist_callback; @@ -1242,9 +1257,10 @@ static void option_dialog_worklist(struct option_dialog *pdialog) } global_worklists_iterate_end; /* Create the adding item. */ - widget = create_iconlabel_from_chars(NULL, window->dst, - _("Add new worklist"), adj_font(12), - WF_RESTORE_BACKGROUND); + widget = create_iconlabel_from_chars_fonto(NULL, window->dst, + _("Add new worklist"), + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); set_wstate(widget, FC_WS_NORMAL); add_to_gui_list(ID_ADD_NEW_WORKLIST, widget); widget->action = add_new_worklist_callback; @@ -1372,7 +1388,8 @@ void init_options_button(void) | WF_RESTORE_BACKGROUND); options_button->action = optiondlg_callback; fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Options"), "Esc"); - options_button->info_label = create_utf8_from_char(buf, adj_font(12)); + options_button->info_label + = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); options_button->key = SDLK_ESCAPE; set_wflag(options_button, WF_HIDDEN); widget_set_position(options_button, adj_size(5), adj_size(5)); diff --git a/client/gui-sdl2/pages.c b/client/gui-sdl2/pages.c index f4f7ce2f82..2158833280 100644 --- a/client/gui-sdl2/pages.c +++ b/client/gui-sdl2/pages.c @@ -160,10 +160,10 @@ static void show_main_page(void) area = pwindow->area; /* Freeciv version */ - /* TRANS: Freeciv 2.4.0 */ + /* TRANS: Freeciv 3.2.0 */ fc_snprintf(verbuf, sizeof(verbuf), _("Freeciv %s"), VERSION_STRING); - pwidget = create_iconlabel_from_chars(NULL, pwindow->dst, verbuf, - adj_font(12), + pwidget = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, verbuf, + FONTO_ATTENTION, (WF_SELECT_WITHOUT_BAR|WF_RESTORE_BACKGROUND|WF_FREE_DATA)); pwidget->string_utf8->style |= SF_CENTER | TTF_STYLE_BOLD; @@ -176,8 +176,8 @@ static void show_main_page(void) /* TRANS: gui-sdl2 client */ fc_snprintf(verbuf, sizeof(verbuf), _("%s client"), client_string); - pwidget = create_iconlabel_from_chars(NULL, pwindow->dst, verbuf, - adj_font(12), + pwidget = create_iconlabel_from_chars_fonto(NULL, pwindow->dst, verbuf, + FONTO_ATTENTION, (WF_SELECT_WITHOUT_BAR|WF_RESTORE_BACKGROUND|WF_FREE_DATA)); pwidget->string_utf8->style |= SF_CENTER | TTF_STYLE_BOLD; diff --git a/client/gui-sdl2/plrdlg.c b/client/gui-sdl2/plrdlg.c index 77be35bcb2..3b7a9ed584 100644 --- a/client/gui-sdl2/plrdlg.c +++ b/client/gui-sdl2/plrdlg.c @@ -362,7 +362,8 @@ void popup_players_dialog(bool raise) pplayers_dlg = fc_calloc(1, sizeof(struct small_dialog)); - pstr = create_utf8_from_char(Q_("?header:Players"), adj_font(12)); + pstr = create_utf8_from_char_fonto(Q_("?header:Players"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -373,11 +374,11 @@ void popup_players_dialog(bool raise) add_to_gui_list(ID_WINDOW, pwindow); pplayers_dlg->end_widget_list = pwindow; /* ---------- */ - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); buf->action = exit_players_dlg_callback; set_wstate(buf, FC_WS_NORMAL); buf->key = SDLK_ESCAPE; @@ -680,7 +681,7 @@ void popup_players_nations_dialog(void) short_players_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); /* TRANS: Nations report title */ - pstr = create_utf8_from_char(_("Nations") , adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Nations"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -694,11 +695,11 @@ void popup_players_nations_dialog(void) area = pwindow->area; /* ---------- */ - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w = MAX(area.w, buf->size.w + adj_size(10)); buf->action = exit_players_nations_dlg_callback; set_wstate(buf, FC_WS_NORMAL); diff --git a/client/gui-sdl2/repodlgs.c b/client/gui-sdl2/repodlgs.c index c75f3debde..62751f5b23 100644 --- a/client/gui-sdl2/repodlgs.c +++ b/client/gui-sdl2/repodlgs.c @@ -222,7 +222,8 @@ static int popup_upgrade_unit_callback(struct widget *pwidget) utype_name_translation(ut2), value, tBuf); - pstr = create_utf8_from_char(_("Upgrade Obsolete Units"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Upgrade Obsolete Units"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -250,9 +251,9 @@ static int popup_upgrade_unit_callback(struct widget *pwidget) area.w = MAX(area.w, text->w + adj_size(20)); /* Cancel button */ - buf = create_themeicon_button_from_chars(current_theme->cancel_icon, - pwindow->dst, _("No"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->cancel_icon, + pwindow->dst, _("No"), + FONTO_ATTENTION, 0); buf->action = cancel_upgrade_unit_callback; set_wstate(buf, FC_WS_NORMAL); @@ -262,9 +263,10 @@ static int popup_upgrade_unit_callback(struct widget *pwidget) add_to_gui_list(ID_BUTTON, buf); if (value <= client.conn.playing->economic.gold) { - buf = create_themeicon_button_from_chars(current_theme->ok_icon, - pwindow->dst, - _("Yes"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->ok_icon, + pwindow->dst, + _("Yes"), + FONTO_ATTENTION, 0); buf->action = ok_upgrade_unit_window_callback; set_wstate(buf, FC_WS_NORMAL); @@ -396,7 +398,7 @@ static void real_activeunits_report_dialog_update(struct units_entry *units, FREEUTF8STR(pstr); /* --------------- */ - pstr = create_utf8_from_char(_("Units Report"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Units Report"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -410,10 +412,11 @@ static void real_activeunits_report_dialog_update(struct units_entry *units, area = pwindow->area; /* ------------------------- */ - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); buf->action = exit_units_dlg_callback; set_wstate(buf, FC_WS_NORMAL); buf->key = SDLK_ESCAPE; @@ -492,8 +495,9 @@ static void real_activeunits_report_dialog_update(struct units_entry *units, hh = buf->size.h; add_to_gui_list(MAX_ID - utype_number(i), buf); - /* unit type name */ - pstr = create_utf8_from_char(utype_name_translation(i), adj_font(12)); + /* Unit type name */ + pstr = create_utf8_from_char_fonto(utype_name_translation(i), + FONTO_ATTENTION); pstr->style |= (TTF_STYLE_BOLD|SF_CENTER); buf = create_iconlabel(NULL, pwindow->dst, pstr, (WF_RESTORE_BACKGROUND | WF_SELECT_WITHOUT_BAR)); @@ -1627,7 +1631,7 @@ static int popup_sell_impr_callback(struct widget *pwidget) improvement_name_translation(improvement_by_number(imp))); } - pstr = create_utf8_from_char(_("Sell It?"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Sell It?"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -1655,9 +1659,9 @@ static int popup_sell_impr_callback(struct widget *pwidget) area.h += (text->h + adj_size(10)); /* Cancel button */ - buf = create_themeicon_button_from_chars(current_theme->cancel_icon, - pwindow->dst, _("No"), - adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->cancel_icon, + pwindow->dst, _("No"), + FONTO_ATTENTION, 0); buf->action = cancel_sell_impr_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1667,9 +1671,10 @@ static int popup_sell_impr_callback(struct widget *pwidget) add_to_gui_list(ID_BUTTON, buf); if (count > 0) { - buf = create_themeicon_button_from_chars(current_theme->ok_icon, - pwindow->dst, - _("Sell"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->ok_icon, + pwindow->dst, + _("Sell"), + FONTO_ATTENTION, 0); buf->action = ok_sell_impr_callback; set_wstate(buf, FC_WS_NORMAL); @@ -1851,7 +1856,7 @@ void economy_report_dialog_popup(bool make_modal) get_economy_report_data(entries, &entries_used, &total, &tax); /* --------------- */ - pstr = create_utf8_from_char(_("Economy Report"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Economy Report"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -1867,14 +1872,14 @@ void economy_report_dialog_popup(bool make_modal) /* "Treasury" text surface */ fc_snprintf(cbuf, sizeof(cbuf), _("Treasury: ")); - pstr2 = create_utf8_from_char(cbuf, adj_font(12)); + pstr2 = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr2->style |= TTF_STYLE_BOLD; treasury_text = create_text_surf_from_utf8(pstr2); w3 = MAX(w3, treasury_text->w); - /* "Treasury" value label*/ + /* "Treasury" value label */ fc_snprintf(cbuf, sizeof(cbuf), "%d", client.conn.playing->economic.gold); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= (TTF_STYLE_BOLD|SF_CENTER); buf = create_iconlabel(icons->big_coin, pwindow->dst, pstr, @@ -1892,9 +1897,9 @@ void economy_report_dialog_popup(bool make_modal) w3 = MAX(w3, tax_rate_text->w); /* "Tax Rate" value label */ - /* it is important to leave 1 space at ending of this string */ + /* It is important to leave 1 space at ending of this string. */ fc_snprintf(cbuf, sizeof(cbuf), "%d%% ", client.conn.playing->economic.tax); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= (TTF_STYLE_BOLD|SF_CENTER); buf = create_iconlabel(NULL, pwindow->dst, pstr, WF_RESTORE_BACKGROUND); @@ -1912,7 +1917,7 @@ void economy_report_dialog_popup(bool make_modal) /* "Total Icome" value label */ fc_snprintf(cbuf, sizeof(cbuf), "%d", tax); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; buf = create_iconlabel(NULL, pwindow->dst, pstr, WF_RESTORE_BACKGROUND); @@ -1929,7 +1934,7 @@ void economy_report_dialog_popup(bool make_modal) /* "Total Cost" value label */ fc_snprintf(cbuf, sizeof(cbuf), "%d", total); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; buf = create_iconlabel(NULL, pwindow->dst, pstr, WF_RESTORE_BACKGROUND); @@ -1947,7 +1952,7 @@ void economy_report_dialog_popup(bool make_modal) /* "Net Icome" value label */ fc_snprintf(cbuf, sizeof(cbuf), "%d", tax - total); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= (TTF_STYLE_BOLD|SF_CENTER); if (tax - total < 0) { @@ -2064,7 +2069,7 @@ void economy_report_dialog_popup(bool make_modal) /* ---- */ fc_snprintf(cbuf, sizeof(cbuf), _("Update")); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); buf = create_themeicon_button(current_theme->small_ok_icon, pwindow->dst, pstr, 0); buf->action = apply_taxrates_callback; @@ -2075,7 +2080,7 @@ void economy_report_dialog_popup(bool make_modal) /* ---- */ fc_snprintf(cbuf, sizeof(cbuf), _("Close Dialog (Esc)")); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); buf->info_label = pstr; @@ -2633,19 +2638,19 @@ void real_science_report_dialog_update(void *unused) cost = 0; } - /* update current research icons */ + /* Update current research icons */ FREESURFACE(change_research_button->theme); change_research_button->theme = get_tech_icon(presearch->researching); FREESURFACE(change_research_goal_button->theme); change_research_goal_button->theme = get_tech_icon(presearch->tech_goal); - /* redraw Window */ + /* Redraw Window */ widget_redraw(pwindow); /* ------------------------------------- */ - /* research progress text */ - str = create_utf8_from_char(science_dialog_text(), adj_font(12)); + /* Research progress text */ + str = create_utf8_from_char_fonto(science_dialog_text(), FONTO_ATTENTION); str->style |= SF_CENTER; str->fgcol = *get_theme_color(COLOR_THEME_SCIENCEDLG_TEXT); @@ -2950,7 +2955,8 @@ static void popup_change_research_dialog(void) change_tech_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); - pstr = create_utf8_from_char(_("What should we focus on now?"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("What should we focus on now?"), + FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -2963,11 +2969,11 @@ static void popup_change_research_dialog(void) area = pwindow->area; /* ------------------------- */ - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += buf->size.w + adj_size(10); buf->action = exit_change_tech_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -3139,7 +3145,7 @@ static void popup_change_research_goal_dialog(void) change_tech_dlg = fc_calloc(1, sizeof(struct advanced_dialog)); - pstr = create_utf8_from_char(_("Select target :"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Select target :"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -3152,11 +3158,11 @@ static void popup_change_research_goal_dialog(void) area = pwindow->area; /* ------------------------- */ - /* exit button */ + /* Exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += buf->size.w + adj_size(10); buf->action = exit_change_tech_dlg_callback; set_wstate(buf, FC_WS_NORMAL); @@ -3250,7 +3256,7 @@ static void popup_change_research_goal_dialog(void) area.w = MAX(area.w, (col * buf->size.w + adj_size(2) + i)); area.h = MAX(area.h, count * buf->size.h + adj_size(2)); - /* alloca window theme and win background buffer */ + /* Alloca window theme and win background buffer */ surf = theme_get_background(active_theme, BACKGROUND_CHANGERESEARCHDLG); resize_window(pwindow, surf, NULL, (pwindow->size.w - pwindow->area.w) + area.w, @@ -3263,7 +3269,7 @@ static void popup_change_research_goal_dialog(void) (main_window_width() - pwindow->size.w) / 2, (main_window_height() - pwindow->size.h) / 2); - /* exit button */ + /* Exit button */ buf = pwindow->prev; buf->size.x = area.x + area.w - buf->size.w - 1; buf->size.y = pwindow->size.y + adj_size(2); @@ -3350,7 +3356,7 @@ static int popdown_science_dialog_callback(struct widget *pwidget) } /**********************************************************************//** - Popup (or raise) the science report(F6). It may or may not be modal. + Popup (or raise) the science report(F6). It may or may not be modal. **************************************************************************/ void science_report_dialog_popup(bool raise) { @@ -3370,7 +3376,7 @@ void science_report_dialog_popup(bool raise) presearch = research_get(client_player()); - /* disable research button */ + /* Disable research button */ pwidget = get_research_widget(); set_wstate(pwidget, FC_WS_DISABLED); widget_redraw(pwidget); @@ -3379,7 +3385,7 @@ void science_report_dialog_popup(bool raise) science_dlg = fc_calloc(1, sizeof(struct small_dialog)); /* TRANS: Research report title */ - pstr = create_utf8_from_char(_("Research"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Research"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; #ifdef SMALL_SCREEN @@ -3440,12 +3446,12 @@ void science_report_dialog_popup(bool raise) add_to_gui_list(ID_SCIENCE_DLG_CHANGE_GOAL_BUTTON, change_research_goal_button); /* ------ */ - /* exit button */ + /* Exit button */ exit_button = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - exit_button->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + exit_button->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); exit_button->action = popdown_science_dialog_callback; set_wstate(exit_button, FC_WS_NORMAL); exit_button->key = SDLK_ESCAPE; diff --git a/client/gui-sdl2/spaceshipdlg.c b/client/gui-sdl2/spaceshipdlg.c index 3b6b5c1b63..c9b224420f 100644 --- a/client/gui-sdl2/spaceshipdlg.c +++ b/client/gui-sdl2/spaceshipdlg.c @@ -157,7 +157,7 @@ void popup_spaceship_dialog(struct player *pplayer) fc_snprintf(cbuf, sizeof(cbuf), _("The %s Spaceship"), nation_adjective_for_player(pplayer)); - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pwindow = create_window_skeleton(NULL, pstr, 0); @@ -172,12 +172,12 @@ void popup_spaceship_dialog(struct player *pplayer) area = pwindow->area; /* ---------- */ - /* create exit button */ + /* Create exit button */ buf = create_themeicon(current_theme->small_cancel_icon, pwindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - buf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + buf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); buf->data.player = pplayer; buf->action = exit_space_dialog_callback; set_wstate(buf, FC_WS_NORMAL); @@ -186,15 +186,18 @@ void popup_spaceship_dialog(struct player *pplayer) add_to_gui_list(ID_BUTTON, buf); - buf = create_themeicon_button_from_chars(current_theme->ok_icon, pwindow->dst, - _("Launch"), adj_font(12), 0); + buf = create_themeicon_button_from_chars_fonto(current_theme->ok_icon, + pwindow->dst, + _("Launch"), + FONTO_ATTENTION, 0); buf->action = launch_spaceship_callback; area.w = MAX(area.w, buf->size.w); area.h += buf->size.h + adj_size(20); add_to_gui_list(ID_BUTTON, buf); - pstr = create_utf8_from_char(get_spaceship_descr(NULL), adj_font(12)); + pstr = create_utf8_from_char_fonto(get_spaceship_descr(NULL), + FONTO_ATTENTION); pstr->bgcol = (SDL_Color) {0, 0, 0, 0}; buf = create_iconlabel(NULL, pwindow->dst, pstr, WF_RESTORE_BACKGROUND); area.w = MAX(area.w, buf->size.w); diff --git a/client/gui-sdl2/widget_button.h b/client/gui-sdl2/widget_button.h index 85e2451e13..1c8b202b71 100644 --- a/client/gui-sdl2/widget_button.h +++ b/client/gui-sdl2/widget_button.h @@ -14,22 +14,31 @@ #ifndef FC__WIDGET_BUTTON_H #define FC__WIDGET_BUTTON_H -#define create_icon_button_from_chars(icon, pdest, char_string, ptsize, flags) \ - create_icon_button(icon, pdest, \ - create_utf8_from_char(char_string, ptsize), \ - flags) - -#define create_themeicon_button_from_chars(icon_theme, pdest, char_string, ptsize, flags) \ +#define create_icon_button_from_chars(icon, pdest, char_string, \ + ptsize, flags) \ + create_icon_button(icon, pdest, \ + create_utf8_from_char(char_string, ptsize), \ + flags) + +#define create_icon_button_from_chars_fonto(icon, pdest, char_string, \ + fonto, flags) \ + create_icon_button(icon, pdest, \ + create_utf8_from_char_fonto(char_string, fonto), \ + flags) + +#define create_themeicon_button_from_chars(icon_theme, pdest, \ + char_string, ptsize, flags) \ create_themeicon_button(icon_theme, pdest, \ create_utf8_from_char(char_string, \ ptsize), \ flags) -#define create_themeicon_button_from_chars_fonto(icon_theme, pdest, \ - char_string, fonto, flags) \ - create_themeicon_button(icon_theme, pdest, \ - create_utf8_from_char_fonto(char_string, \ - fonto), \ +#define create_themeicon_button_from_chars_fonto(icon_theme, pdest, \ + char_string, \ + fonto, flags) \ + create_themeicon_button(icon_theme, pdest, \ + create_utf8_from_char_fonto(char_string, \ + fonto), \ flags) struct widget *create_icon_button(SDL_Surface *icon, diff --git a/client/gui-sdl2/widget_combo.h b/client/gui-sdl2/widget_combo.h index 84358a98e6..9779f135b2 100644 --- a/client/gui-sdl2/widget_combo.h +++ b/client/gui-sdl2/widget_combo.h @@ -1,4 +1,4 @@ -/********************************************************************** +/*********************************************************************** Freeciv - Copyright (C) 2006 - The Freeciv Project This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -14,12 +14,22 @@ #ifndef FC__WIDGET_COMBO_H #define FC__WIDGET_COMBO_H +/* client/gui-sdl2 */ +#include "gui_string.h" + struct strvec; #define combo_new_from_chars(background, dest, font_size, \ char_string, vector, length, flags) \ - combo_new(background, dest, create_utf8_from_char(char_string, \ - font_size), vector, length, flags) + combo_new(background, dest, \ + create_utf8_from_char(char_string, font_size), \ + vector, length, flags) + +#define combo_new_from_chars_fonto(background, dest, fonto, \ + char_string, vector, length, flags) \ + combo_new(background, dest, \ + create_utf8_from_char_fonto(char_string, fonto), \ + vector, length, flags) struct widget *combo_new(SDL_Surface *background, struct gui_layer *dest, utf8_str *pstr, const struct strvec *vector, diff --git a/client/gui-sdl2/wldlg.c b/client/gui-sdl2/wldlg.c index ce7935a1b7..1aa2015f3e 100644 --- a/client/gui-sdl2/wldlg.c +++ b/client/gui-sdl2/wldlg.c @@ -1126,7 +1126,7 @@ void popup_worklist_editor(struct city *pcity, struct global_worklist *gwl) fc_snprintf(cbuf, sizeof(cbuf), "%s", global_worklist_name(gwl)); } - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= (TTF_STYLE_BOLD|SF_CENTER); buf = create_iconlabel(NULL, pwindow->dst, pstr, WF_RESTORE_BACKGROUND); @@ -1135,7 +1135,7 @@ void popup_worklist_editor(struct city *pcity, struct global_worklist *gwl) /* --------------------------- */ fc_snprintf(cbuf, sizeof(cbuf), - /* TRANS: length of worklist */ + /* TRANS: Length of worklist */ PL_("( %d entry )", "( %d entries )", len), len); pstr = create_utf8_from_char_fonto(cbuf, FONTO_DEFAULT); pstr->bgcol = (SDL_Color) {0, 0, 0, 0}; @@ -1191,7 +1191,7 @@ void popup_worklist_editor(struct city *pcity, struct global_worklist *gwl) } else { fc_snprintf(cbuf, sizeof(cbuf), "-"); } - pstr = create_utf8_from_char(cbuf, adj_font(12)); + pstr = create_utf8_from_char_fonto(cbuf, FONTO_ATTENTION); pstr->style |= (TTF_STYLE_BOLD|SF_CENTER); buf = create_iconlabel(icon, pwindow->dst, pstr, -- 2.39.2