From a66cd636591a5289b207927168756591e105c0c4 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 28 May 2023 19:57:20 +0300 Subject: [PATCH 3/3] 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 | 86 +++++++++------- client/gui-sdl2/citydlg.c | 117 +++++++++++---------- client/gui-sdl2/cityrep.c | 26 ++--- client/gui-sdl2/cma_fe.c | 75 +++++++------- client/gui-sdl2/connectdlg.c | 18 ++-- client/gui-sdl2/dialogs.c | 158 ++++++++++++++++------------- client/gui-sdl2/diplodlg.c | 173 ++++++++++++++++++-------------- 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 | 157 ++++++++++++++++------------- client/gui-sdl2/inteldlg.c | 18 ++-- client/gui-sdl2/mapctrl.c | 70 ++++++------- client/gui-sdl2/mapview.c | 5 +- client/gui-sdl2/messagewin.c | 4 +- client/gui-sdl2/optiondlg.c | 148 +++++++++++++++------------ client/gui-sdl2/pages.c | 10 +- client/gui-sdl2/plrdlg.c | 17 ++-- client/gui-sdl2/repodlgs.c | 108 +++++++++++--------- client/gui-sdl2/spaceshipdlg.c | 16 +-- client/gui-sdl2/widget_button.h | 5 + client/gui-sdl2/widget_combo.h | 16 ++- client/gui-sdl2/wldlg.c | 6 +- 25 files changed, 735 insertions(+), 586 deletions(-) diff --git a/client/gui-sdl2/action_dialog.c b/client/gui-sdl2/action_dialog.c index 112b5c712e..847d87008c 100644 --- a/client/gui-sdl2/action_dialog.c +++ b/client/gui-sdl2/action_dialog.c @@ -476,7 +476,8 @@ static int spy_steal_popup(struct widget *pWidget) pDiplomat_Dlg->target_ids[ATK_CITY] = pVcity->id; pDiplomat_Dlg->pdialog = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - 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); @@ -491,11 +492,11 @@ static int spy_steal_popup(struct widget *pWidget) area.w = MAX(area.w, adj_size(8)); /* ------------------ */ - /* 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += pBuf->size.w + adj_size(10); pBuf->action = exit_spy_tgt_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -922,10 +923,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; @@ -1196,9 +1198,10 @@ void popup_sabotage_dialog(struct unit *actor, struct city *pCity) pCont = fc_calloc(1, sizeof(struct CONTAINER)); pCont->id0 = pCity->id; - pCont->id1 = actor->id; /* spy id */ + pCont->id1 = actor->id; /* Spy 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); @@ -1213,11 +1216,11 @@ void popup_sabotage_dialog(struct unit *actor, struct city *pCity) area.h = MAX(area.h, adj_size(2)); /* ---------- */ - /* 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += pBuf->size.w + adj_size(10); pBuf->action = exit_spy_tgt_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1498,8 +1501,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; @@ -1516,12 +1519,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 */ 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += pBuf->size.w + adj_size(10); pBuf->action = exit_incite_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1586,12 +1589,12 @@ void popup_incite_dialog(struct unit *actor, struct city *pCity, int cost) area.h += pBuf->size.h; } else { - /* 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += pBuf->size.w + adj_size(10); pBuf->action = exit_incite_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1759,8 +1762,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; @@ -1812,12 +1815,12 @@ void popup_bribe_dialog(struct unit *actor, struct unit *pUnit, int cost) area.h += pBuf->size.h; } else { - /* 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += pBuf->size.w + adj_size(10); pBuf->action = exit_bribe_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); diff --git a/client/gui-sdl2/chatline.c b/client/gui-sdl2/chatline.c index 9199ced980..400a105745 100644 --- a/client/gui-sdl2/chatline.c +++ b/client/gui-sdl2/chatline.c @@ -198,10 +198,11 @@ static void popup_load_game_dialog(void) widget_redraw(pConnDlg->pStartButton); widget_mark_dirty(pConnDlg->pStartButton); - /* create dialog */ + /* Create dialog */ pLoadDialog = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - 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); @@ -214,12 +215,12 @@ static void popup_load_game_dialog(void) area = pWindow->area; - /* close button */ + /* Close button */ pCloseButton = create_themeicon(current_theme->Small_CANCEL_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pCloseButton->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + pCloseButton->info_label + = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), FONTO_ATTENTION); pCloseButton->action = exit_load_dlg_callback; set_wstate(pCloseButton, FC_WS_NORMAL); pCloseButton->key = SDLK_ESCAPE; @@ -230,11 +231,11 @@ static void popup_load_game_dialog(void) pLoadDialog->pBeginWidgetList = pCloseButton; - /* create scrollbar */ + /* Create scrollbar */ scrollbar_width = create_vertical_scrollbar(pLoadDialog, 1, 20, TRUE, TRUE); hide_scrollbar(pLoadDialog->pScroll); - /* search for user saved games. */ + /* Search for user saved games. */ files = fileinfolist_infix(get_save_dirs(), ".sav", FALSE); fileinfo_list_iterate(files, pfile) { count++; @@ -356,8 +357,9 @@ void popup_input_line(void) { struct widget *pInput_Edit; - pInput_Edit = create_edit_from_chars(NULL, Main.gui, "", adj_font(12), - adj_size(400), 0); + pInput_Edit = create_edit_from_chars_fonto(NULL, Main.gui, "", + FONTO_ATTENTION, + adj_size(400), 0); pInput_Edit->size.x = (main_window_width() - pInput_Edit->size.w) / 2; pInput_Edit->size.y = (main_window_height() - pInput_Edit->size.h) / 2; @@ -374,7 +376,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, @@ -444,16 +446,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, pConnDlg->text_width - adj_size(5))) { + if (convert_utf8_str_to_const_surface_width(pstr, + pConnDlg->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}; pBuf = create_themelabel2(NULL, pWindow->dst, pstr2, pConnDlg->text_width, 0, @@ -569,7 +573,7 @@ void real_conn_list_dialog_update(void *unused) if (C_S_PREPARING == client_state()) { if (pConnDlg) { struct widget *pBuf = NULL, *pWindow = pConnDlg->pEndWidgetList; - 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}; @@ -688,7 +692,7 @@ static void popup_conn_list_dialog(void) widget_set_position(pWindow, 0, 0); - /* create window background */ + /* Create window background */ pSurf = theme_get_background(theme, BACKGROUND_CONNLISTDLG); if (resize_window(pWindow, pSurf, NULL, main_window_width(), main_window_height())) { FREESURFACE(pSurf); @@ -696,7 +700,7 @@ static void popup_conn_list_dialog(void) pConnDlg->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 = pConnDlg->text_width + adj_size(20); @@ -707,7 +711,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); @@ -722,7 +726,7 @@ static void popup_conn_list_dialog(void) /* -------------------------------- */ - /* chat area */ + /* Chat area */ pConnDlg->pChat_Dlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); @@ -732,7 +736,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}; @@ -765,9 +769,10 @@ static void popup_conn_list_dialog(void) /* Input field */ - pBuf = 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)); + pBuf = 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)); pBuf->size.x = adj_size(10); pBuf->size.y = pWindow->size.h - adj_size(40) - adj_size(5) - pBuf->size.h; @@ -778,8 +783,9 @@ static void popup_conn_list_dialog(void) /* Buttons */ - pBuf = create_themeicon_button_from_chars(current_theme->BACK_Icon, pWindow->dst, - _("Back"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->BACK_Icon, + pWindow->dst, + _("Back"), FONTO_ATTENTION, 0); pBuf->size.x = adj_size(10); pBuf->size.y = pWindow->size.h - adj_size(10) - pBuf->size.h; pConnDlg->pBackButton = pBuf; @@ -789,8 +795,10 @@ static void popup_conn_list_dialog(void) add_to_gui_list(ID_BUTTON, pBuf); pBackButton = pBuf; - pBuf = create_themeicon_button_from_chars(current_theme->OK_Icon, pWindow->dst, - _("Start"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->OK_Icon, + pWindow->dst, + _("Start"), + FONTO_ATTENTION, 0); pBuf->size.x = pWindow->size.w - adj_size(10) - pBuf->size.w; pBuf->size.y = pBackButton->size.y; pConnDlg->pStartButton = pBuf; @@ -799,8 +807,9 @@ static void popup_conn_list_dialog(void) add_to_gui_list(ID_BUTTON, pBuf); pStartGameButton = pBuf; - pBuf = create_themeicon_button_from_chars(NULL, pWindow->dst, - _("Pick Nation"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(NULL, pWindow->dst, + _("Pick Nation"), + FONTO_ATTENTION, 0); pBuf->size.h = pStartGameButton->size.h; pBuf->size.x = pStartGameButton->size.x - adj_size(10) - pBuf->size.w; pBuf->size.y = pStartGameButton->size.y; @@ -810,8 +819,9 @@ static void popup_conn_list_dialog(void) add_to_gui_list(ID_BUTTON, pBuf); pSelectNationButton = pBuf; - pBuf = create_themeicon_button_from_chars(NULL, pWindow->dst, - _("Load Game"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(NULL, pWindow->dst, + _("Load Game"), + FONTO_ATTENTION, 0); pBuf->size.h = pSelectNationButton->size.h; pBuf->size.x = pSelectNationButton->size.x - adj_size(10) - pBuf->size.w; pBuf->size.y = pSelectNationButton->size.y; @@ -820,11 +830,11 @@ static void popup_conn_list_dialog(void) set_wstate(pBuf, FC_WS_NORMAL); add_to_gui_list(ID_BUTTON, pBuf); - /* not implemented yet */ + /* Not implemented yet */ #if 0 - pBuf = create_themeicon_button_from_chars(NULL, pWindow->dst, - _("Server Settings"), - adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(NULL, pWindow->dst, + _("Server Settings"), + FONTO_ATTENTION, 0); pBuf->size.h = pSelectNationButton->size.h; pBuf->size.x = pSelectNationButton->size.x - adj_size(10) - pBuf->size.w; pBuf->size.y = pSelectNationButton->size.y; @@ -835,10 +845,10 @@ static void popup_conn_list_dialog(void) pServerSettingsButton = pBuf; #endif - /* not implemented yet */ + /* Not implemented yet */ #if 0 - pBuf = create_themeicon_button_from_chars(NULL, pWindow->dst->surface, - "?", adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(NULL, pWindow->dst->surface, + "?", FONTO_ATTENTION, 0); pBuf->size.y = pWindow->size.y + pWindow->size.h - (pBuf->size.h + 7); pBuf->size.x = pWindow->size.x + pWindow->size.w - (pBuf->size.w + 10) - 5; diff --git a/client/gui-sdl2/citydlg.c b/client/gui-sdl2/citydlg.c index 1fca7d3e8c..b28b28d8aa 100644 --- a/client/gui-sdl2/citydlg.c +++ b/client/gui-sdl2/citydlg.c @@ -411,7 +411,7 @@ static int units_orders_city_dlg_callback(struct widget *pButton) /* 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); @@ -424,7 +424,7 @@ static int units_orders_city_dlg_callback(struct widget *pButton) /* 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); pBuf = create_iconlabel(adj_surf(get_unittype_surface(pUType, punit->facing)), pWindow->dst, pstr, WF_FREE_THEME); @@ -432,8 +432,9 @@ static int units_orders_city_dlg_callback(struct widget *pButton) add_to_gui_list(ID_LABEL, pBuf); /* Activate unit */ - pBuf = create_icon_button_from_chars(NULL, pWindow->dst, - _("Activate unit"), adj_font(12), 0); + pBuf = create_icon_button_from_chars_fonto(NULL, pWindow->dst, + _("Activate unit"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, pBuf->size.w); hh = MAX(hh, pBuf->size.h); @@ -443,8 +444,9 @@ static int units_orders_city_dlg_callback(struct widget *pButton) add_to_gui_list(pButton->ID, pBuf); /* Activate unit, close dlg. */ - pBuf = create_icon_button_from_chars(NULL, pWindow->dst, - _("Activate unit, close dialog"), adj_font(12), 0); + pBuf = create_icon_button_from_chars_fonto(NULL, pWindow->dst, + _("Activate unit, close dialog"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, pBuf->size.w); hh = MAX(hh, pBuf->size.h); @@ -456,8 +458,9 @@ static int units_orders_city_dlg_callback(struct widget *pButton) if (pCityDlg->page == ARMY_PAGE) { /* Sentry unit */ - pBuf = create_icon_button_from_chars(NULL, pWindow->dst, - _("Sentry unit"), adj_font(12), 0); + pBuf = create_icon_button_from_chars_fonto(NULL, pWindow->dst, + _("Sentry unit"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, pBuf->size.w); hh = MAX(hh, pBuf->size.h); @@ -471,8 +474,9 @@ static int units_orders_city_dlg_callback(struct widget *pButton) /* ----- */ /* Fortify unit */ - pBuf = create_icon_button_from_chars(NULL, pWindow->dst, - _("Fortify unit"), adj_font(12), 0); + pBuf = create_icon_button_from_chars_fonto(NULL, pWindow->dst, + _("Fortify unit"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, pBuf->size.w); hh = MAX(hh, pBuf->size.h); @@ -487,8 +491,9 @@ static int units_orders_city_dlg_callback(struct widget *pButton) /* ----- */ /* Disband unit */ - pBuf = create_icon_button_from_chars(NULL, pWindow->dst, - _("Disband unit"), adj_font(12), 0); + pBuf = create_icon_button_from_chars_fonto(NULL, pWindow->dst, + _("Disband unit"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, pBuf->size.w); hh = MAX(hh, pBuf->size.h); @@ -501,8 +506,9 @@ static int units_orders_city_dlg_callback(struct widget *pButton) if (pCityDlg->page == ARMY_PAGE) { if (punit->homecity != pCityDlg->pCity->id) { /* Make new Homecity */ - pBuf = create_icon_button_from_chars(NULL, pWindow->dst, - _("Set Home City"), adj_font(12), 0); + pBuf = create_icon_button_from_chars_fonto(NULL, pWindow->dst, + _("Set Home City"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, pBuf->size.w); hh = MAX(hh, pBuf->size.h); @@ -515,8 +521,9 @@ static int units_orders_city_dlg_callback(struct widget *pButton) if (can_upgrade_unittype(client.conn.playing, pUType)) { /* Upgrade unit */ - pBuf = create_icon_button_from_chars(NULL, pWindow->dst, - _("Upgrade unit"), adj_font(12), 0); + pBuf = create_icon_button_from_chars_fonto(NULL, pWindow->dst, + _("Upgrade unit"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, pBuf->size.w); hh = MAX(hh, pBuf->size.h); @@ -529,8 +536,9 @@ static int units_orders_city_dlg_callback(struct widget *pButton) /* ----- */ /* Cancel */ - pBuf = create_icon_button_from_chars(NULL, pWindow->dst, - _("Cancel"), adj_font(12), 0); + pBuf = create_icon_button_from_chars_fonto(NULL, pWindow->dst, + _("Cancel"), + FONTO_ATTENTION, 0); i++; area.w = MAX(area.w, pBuf->size.w); hh = MAX(hh, pBuf->size.h); @@ -1187,7 +1195,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; @@ -1212,8 +1220,9 @@ void popup_hurry_production_dialog(struct city *pCity, SDL_Surface *pDest) area.w = MAX(area.w , pText->w); area.h += pText->h + adj_size(5); - pBuf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, - pWindow->dst, _("No"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->CANCEL_Icon, + pWindow->dst, _("No"), + FONTO_ATTENTION, 0); pBuf->action = cancel_buy_prod_city_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1223,8 +1232,10 @@ void popup_hurry_production_dialog(struct city *pCity, SDL_Surface *pDest) add_to_gui_list(ID_BUTTON, pBuf); if (city_can_buy(pCity) && (value <= client.conn.playing->economic.gold)) { - pBuf = create_themeicon_button_from_chars(current_theme->OK_Icon, pWindow->dst, - _("Yes"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->OK_Icon, + pWindow->dst, + _("Yes"), + FONTO_ATTENTION, 0); pBuf->action = ok_buy_prod_city_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1399,11 +1410,11 @@ static int sell_imprvm_dlg_callback(struct widget *pImpr) 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); pCityDlg->pEndCityMenuWidgetList = pWindow; @@ -3522,7 +3533,7 @@ void real_city_dialog_popup(struct city *pCity) pCityDlg->pCity = pCity; pCityDlg->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); @@ -3552,11 +3563,11 @@ void real_city_dialog_popup(struct city *pCity) /* ============================================================= */ - /* close dialog button */ + /* Close dialog 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pBuf->action = exit_city_dlg_callback; pBuf->size.x = area.x + area.w - pBuf->size.w; pBuf->size.y = pWindow->size.y + adj_size(2); @@ -3568,8 +3579,8 @@ void real_city_dialog_popup(struct city *pCity) pBuf = create_themeicon(current_theme->Army_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("Present units"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Present units"), + FONTO_ATTENTION); pBuf->action = army_city_dlg_callback; pBuf->size.x = area.x + adj_size(2) + ((adj_size(183) - 5 * pBuf->size.w) / 6); pBuf->size.y = area.y + adj_size(2); @@ -3579,8 +3590,8 @@ void real_city_dialog_popup(struct city *pCity) pBuf = create_themeicon(current_theme->Support_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("Supported units"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Supported units"), + FONTO_ATTENTION); pBuf->action = supported_unit_city_dlg_callback; pBuf->size.x = area.x + adj_size(2) + 2 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + pBuf->size.w; @@ -3592,10 +3603,11 @@ void real_city_dialog_popup(struct city *pCity) pBuf = create_themeicon(current_theme->Happy_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("Happiness"), adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Happiness"), + FONTO_ATTENTION); pBuf->action = happy_city_dlg_callback; - pBuf->size.x = - area.x + adj_size(2) + 3 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + 2 * pBuf->size.w; + pBuf->size.x + = area.x + adj_size(2) + 3 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + 2 * pBuf->size.w; pBuf->size.y = area.y + adj_size(2); set_wstate(pBuf, FC_WS_NORMAL); add_to_gui_list(ID_CITY_DLG_HAPPY_BUTTON, pBuf); @@ -3603,10 +3615,11 @@ void real_city_dialog_popup(struct city *pCity) pBuf = create_themeicon(current_theme->INFO_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("City info"), adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("City info"), + FONTO_ATTENTION); pBuf->action = info_city_dlg_callback; - pBuf->size.x = - area.x + adj_size(4) + 4 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + 3 * pBuf->size.w; + pBuf->size.x + = area.x + adj_size(4) + 4 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + 3 * pBuf->size.w; pBuf->size.y = area.y + adj_size(2); set_wstate(pBuf, FC_WS_NORMAL); add_to_gui_list(ID_CITY_DLG_INFO_BUTTON, pBuf); @@ -3635,10 +3648,11 @@ void real_city_dialog_popup(struct city *pCity) pBuf = create_themeicon(current_theme->Options_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("City options"), adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("City options"), + FONTO_ATTENTION); pBuf->action = options_city_dlg_callback; - pBuf->size.x = - area.x + adj_size(4) + 5 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + 4 * pBuf->size.w; + pBuf->size.x + = area.x + adj_size(4) + 5 * ((adj_size(183) - 5 * pBuf->size.w) / 6) + 4 * pBuf->size.w; pBuf->size.y = area.y + adj_size(2); if (pOwner == client.conn.playing) { set_wstate(pBuf, FC_WS_NORMAL); @@ -3648,8 +3662,8 @@ void real_city_dialog_popup(struct city *pCity) pBuf = create_themeicon(current_theme->PROD_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("Change production"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Change production"), + FONTO_ATTENTION); pBuf->action = change_prod_dlg_callback; pBuf->size.x = area.x + adj_size(7); pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(5); @@ -3662,8 +3676,8 @@ void real_city_dialog_popup(struct city *pCity) pBuf = create_themeicon(current_theme->Buy_PROD_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("Hurry production"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Hurry production"), + FONTO_ATTENTION); pBuf->action = buy_prod_city_dlg_callback; pBuf->size.x = area.x + adj_size(7) + (pBuf->size.w + adj_size(2)); pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(5); @@ -3677,8 +3691,8 @@ void real_city_dialog_popup(struct city *pCity) pBuf = create_themeicon(current_theme->CMA_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("Citizen Governor"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Citizen Governor"), + FONTO_ATTENTION); pBuf->action = cma_city_dlg_callback; pBuf->key = SDLK_a; pBuf->size.x = area.x + adj_size(7) + (pBuf->size.w + adj_size(2)) * 2; @@ -3692,8 +3706,8 @@ void real_city_dialog_popup(struct city *pCity) /* -------- */ pBuf = create_themeicon(current_theme->L_ARROW_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("Previous city"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Previous city"), + FONTO_ATTENTION); pBuf->action = next_prev_city_dlg_callback; pBuf->size.x = area.x + adj_size(220) - pBuf->size.w - adj_size(8); pBuf->size.y = area.y + area.h - pBuf->size.h; @@ -3707,7 +3721,8 @@ void real_city_dialog_popup(struct city *pCity) pBuf = create_themeicon(current_theme->R_ARROW_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("Next city"), adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Next city"), + FONTO_ATTENTION); pBuf->action = next_prev_city_dlg_callback; pBuf->size.x = area.x + adj_size(420) + adj_size(2); pBuf->size.y = area.y + area.h - pBuf->size.h; diff --git a/client/gui-sdl2/cityrep.c b/client/gui-sdl2/cityrep.c index e115f41d13..7f18dad95a 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) pCMA_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,7 +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); @@ -270,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); @@ -280,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); @@ -293,7 +295,7 @@ static void real_info_city_report_dialog_update(void) pLast = 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 a22b3bb2a8..d104619f44 100644 --- a/client/gui-sdl2/cma_fe.c +++ b/client/gui-sdl2/cma_fe.c @@ -314,7 +314,8 @@ static int save_cma_callback(struct widget *pWidget) pCma->pAdv = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - 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); @@ -342,7 +343,9 @@ static int save_cma_callback(struct widget *pWidget) /* ============================================================= */ pBuf = create_edit(NULL, pWindow->dst, - create_utf8_from_char(_("new preset"), adj_font(12)), adj_size(100), + create_utf8_from_char_fonto(_("new preset"), + FONTO_ATTENTION), + adj_size(100), (WF_RESTORE_BACKGROUND|WF_FREE_STRING)); set_wstate(pBuf, FC_WS_NORMAL); area.h += pBuf->size.h; @@ -351,8 +354,10 @@ static int save_cma_callback(struct widget *pWidget) add_to_gui_list(ID_EDIT, pBuf); /* ============================================================= */ - pBuf = create_themeicon_button_from_chars(current_theme->OK_Icon, pWindow->dst, - _("Yes"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->OK_Icon, + pWindow->dst, + _("Yes"), + FONTO_ATTENTION, 0); pBuf->action = ok_save_cma_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -360,9 +365,9 @@ static int save_cma_callback(struct widget *pWidget) add_to_gui_list(ID_BUTTON, pBuf); pBuf->data.ptr = (void *)pBuf->next; - pBuf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, - pWindow->dst, _("No"), - adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->CANCEL_Icon, + pWindow->dst, _("No"), + FONTO_ATTENTION, 0); pBuf->action = cancel_SLD_cma_callback; set_wstate(pBuf, FC_WS_NORMAL); pBuf->key = SDLK_ESCAPE; @@ -495,7 +500,7 @@ static void popup_load_del_presets_dialog(bool load, struct widget *pButton) pCma->pAdv = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - 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); @@ -509,11 +514,11 @@ static void popup_load_del_presets_dialog(bool load, struct widget *pButton) area = pWindow->area; /* ---------- */ - /* create exit button */ + /* Create 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pBuf->action = cancel_SLD_cma_callback; set_wstate(pBuf, FC_WS_NORMAL); pBuf->key = SDLK_ESCAPE; @@ -788,15 +793,15 @@ void update_city_cma_dialog(void) } } - /* create result text surface */ - pstr = create_utf8_from_char(cmafec_get_result_descr(pCma->pCity, result, - &pCma->edited_cm_parm), - adj_font(12)); + /* Create result text surface */ + pstr = create_utf8_from_char_fonto(cmafec_get_result_descr(pCma->pCity, result, + &pCma->edited_cm_parm), + FONTO_ATTENTION); pText = create_text_surf_from_utf8(pstr); FREEUTF8STR(pstr); - /* fill result text background */ + /* Fill result text background */ dst.x = pBuf->area.x + adj_size(7); dst.y = pBuf->area.y + adj_size(186); dst.w = pText->w + adj_size(10); @@ -912,7 +917,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); @@ -925,11 +930,11 @@ void popup_city_cma_dialog(struct city *pCity) area = pWindow->area; /* ---------- */ - /* create exit button */ + /* Create 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pBuf->action = exit_cma_dialog_callback; set_wstate(pBuf, FC_WS_NORMAL); pBuf->key = SDLK_ESCAPE; @@ -937,7 +942,7 @@ void popup_city_cma_dialog(struct city *pCity) add_to_gui_list(ID_BUTTON, pBuf); - 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")); @@ -1014,7 +1019,7 @@ void popup_city_cma_dialog(struct city *pCity) add_to_gui_list(ID_SCROLLBAR, pBuf); - /* celebrating */ + /* Celebrating */ pBuf = create_checkbox(pWindow->dst, pCma->edited_cm_parm.require_happy, WF_RESTORE_BACKGROUND); @@ -1172,12 +1177,12 @@ 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)); - /* factor label */ + /* Factor label */ pBuf = pBuf->prev; pBuf->size.x = pBuf->next->size.x + adj_size(75); pBuf->size.y = pWindow->size.y + dst.y + (pText[i]->h - pBuf->size.h) / 2; - /* factor sb */ + /* Factor sb */ pBuf = pBuf->prev; pBuf->size.x = pBuf->next->size.x + pBuf->next->size.w + adj_size(5); pBuf->size.y = pWindow->size.y + dst.y + (pText[i]->h - pBuf->size.h) / 2; @@ -1197,12 +1202,12 @@ void popup_city_cma_dialog(struct city *pCity) FREESURFACE(pText[i]); } output_type_iterate_end; - /* happy factor label */ + /* Happy factor label */ pBuf = pBuf->prev; pBuf->size.x = pBuf->next->next->size.x; pBuf->size.y = pWindow->size.y + dst.y + (pText[O_LAST]->h - pBuf->size.h) / 2; - /* happy factor sb */ + /* Happy factor sb */ pBuf = pBuf->prev; pBuf->size.x = pBuf->next->size.x + pBuf->next->size.w + adj_size(5); pBuf->size.y = pWindow->size.y + dst.y + (pText[O_LAST]->h - pBuf->size.h) / 2; @@ -1217,19 +1222,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 */ pBuf = pBuf->prev; pBuf->size.x = pWindow->size.x + dst.x + adj_size(10); pBuf->size.y = pWindow->size.y + dst.y; - /* celebrate static text */ + /* Celebrate static text */ dst.x += (adj_size(10) + pBuf->size.w + adj_size(5)); dst.y += (pBuf->size.h - pText[O_LAST]->h) / 2; alphablit(pText[O_LAST], NULL, pWindow->theme, &dst, 255); FREESURFACE(pText[O_LAST]); /* ------------------------ */ - /* save as */ + /* Save as */ pBuf = pBuf->prev; pBuf->size.x = pWindow->size.x + x + (w - (pBuf->size.w + adj_size(6)) * 6) / 2; pBuf->size.y = pWindow->size.y + pWindow->size.h - pBuf->size.h * 2 - adj_size(10); @@ -1244,33 +1249,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 */ pBuf = pBuf->prev; pBuf->size.x = pBuf->next->size.x + pBuf->next->size.w + adj_size(4); pBuf->size.y = pBuf->next->size.y; - /* del */ + /* Del */ pBuf = pBuf->prev; pBuf->size.x = pBuf->next->size.x + pBuf->next->size.w + adj_size(4); pBuf->size.y = pBuf->next->size.y; - /* run */ + /* Run */ pBuf = pBuf->prev; pBuf->size.x = pBuf->next->size.x + pBuf->next->size.w + adj_size(4); pBuf->size.y = pBuf->next->size.y; - /* run one time */ + /* Run one time */ pBuf = pBuf->prev; pBuf->size.x = pBuf->next->size.x + pBuf->next->size.w + adj_size(4); pBuf->size.y = pBuf->next->size.y; - /* del */ + /* Del */ pBuf = pBuf->prev; pBuf->size.x = pBuf->next->size.x + pBuf->next->size.w + adj_size(4); pBuf->size.y = pBuf->next->size.y; /* ------------------------ */ - /* check if Citizen Icons style was loaded */ + /* Check if Citizen Icons style was loaded */ cs = style_of_city(pCma->pCity); if (cs != pIcons->style) { diff --git a/client/gui-sdl2/connectdlg.c b/client/gui-sdl2/connectdlg.c index a69b542703..6e960548f9 100644 --- a/client/gui-sdl2/connectdlg.c +++ b/client/gui-sdl2/connectdlg.c @@ -800,15 +800,15 @@ static void popup_user_passwd_dialog(const char *pMessage) area = pWindow->area; - /* text label */ - label_str = create_utf8_from_char(pMessage, adj_font(12)); + /* Text label */ + label_str = create_utf8_from_char_fonto(pMessage, FONTO_ATTENTION); label_str->fgcol = *get_theme_color(COLOR_THEME_USERPASSWDDLG_TEXT); pBuf = create_iconlabel(NULL, pWindow->dst, label_str, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); add_to_gui_list(ID_LABEL, pBuf); area.h += adj_size(10) + pBuf->size.h + adj_size(5); - /* password edit */ + /* Password edit */ pBuf = 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)); @@ -858,7 +858,7 @@ static void popup_user_passwd_dialog(const char *pMessage) (main_window_width() - pWindow->size.w) / 2, (main_window_height() - pWindow->size.h) / 2); - /* text label */ + /* Text label */ pBuf = pConnectDlg->pEndWidgetList->prev; start_x = area.x + (area.w - pBuf->size.w) / 2; @@ -869,7 +869,7 @@ static void popup_user_passwd_dialog(const char *pMessage) start_y += pBuf->size.h + adj_size(5); - /* password edit */ + /* Password edit */ pBuf = pBuf->prev; start_x = area.x + (area.w - pBuf->size.w) / 2; @@ -963,15 +963,15 @@ static void popup_new_user_passwd_dialog(const char *pMessage) area = pWindow->area; - /* text label */ - label_str = create_utf8_from_char(pMessage, adj_font(12)); + /* Text label */ + label_str = create_utf8_from_char_fonto(pMessage, FONTO_ATTENTION); label_str->fgcol = *get_theme_color(COLOR_THEME_USERPASSWDDLG_TEXT); pBuf = create_iconlabel(NULL, pWindow->dst, label_str, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); add_to_gui_list(ID_LABEL, pBuf); area.h += adj_size(10) + pBuf->size.h + adj_size(5); - /* password edit */ + /* Password edit */ pBuf = 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)); @@ -980,7 +980,7 @@ static void popup_new_user_passwd_dialog(const char *pMessage) add_to_gui_list(ID_EDIT, pBuf); area.h += pBuf->size.h + adj_size(5); - /* second password edit */ + /* Second password edit */ pBuf = 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 a03b2dd6c7..1ac1d5646c 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) { @@ -317,7 +317,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); @@ -331,8 +331,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); @@ -385,9 +385,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); @@ -430,7 +431,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, @@ -517,7 +518,7 @@ void popup_notify_dialog(const char *caption, const char *headline, pNotifyDlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - 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); @@ -531,11 +532,11 @@ void popup_notify_dialog(const char *caption, const char *headline, area = pWindow->area; /* ---------- */ - /* create exit button */ + /* Create 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pBuf->action = exit_notify_dialog_callback; set_wstate(pBuf, FC_WS_NORMAL); pBuf->key = SDLK_ESCAPE; @@ -550,7 +551,7 @@ void popup_notify_dialog(const char *caption, const char *headline, pHeadline = 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); pLines = create_text_surf_from_utf8(pstr); @@ -678,7 +679,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); @@ -705,10 +707,10 @@ void popup_unit_upgrade_dlg(struct unit *pUnit, bool city) area.w = MAX(area.w, pText->w + adj_size(20)); area.h += (pText->h + adj_size(10)); - /* cancel button */ - pBuf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, - pWindow->dst, _("Cancel"), - adj_font(12), 0); + /* Cancel button */ + pBuf = create_themeicon_button_from_chars_fonto(current_theme->CANCEL_Icon, + pWindow->dst, _("Cancel"), + FONTO_ATTENTION, 0); pBuf->action = cancel_upgrade_unit_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -718,8 +720,10 @@ void popup_unit_upgrade_dlg(struct unit *pUnit, bool city) add_to_gui_list(ID_BUTTON, pBuf); if (UU_OK == unit_upgrade_result) { - pBuf = create_themeicon_button_from_chars(current_theme->OK_Icon, pWindow->dst, - _("Upgrade"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->OK_Icon, + pWindow->dst, + _("Upgrade"), + FONTO_ATTENTION, 0); pBuf->action = ok_upgrade_unit_window_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -874,7 +878,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); @@ -901,10 +905,10 @@ void popup_unit_disband_dlg(struct unit *pUnit, bool city) area.w = MAX(area.w, pText->w + adj_size(20)); area.h += (pText->h + adj_size(10)); - /* cancel button */ - pBuf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, - pWindow->dst, _("Cancel"), - adj_font(12), 0); + /* Cancel button */ + pBuf = create_themeicon_button_from_chars_fonto(current_theme->CANCEL_Icon, + pWindow->dst, _("Cancel"), + FONTO_ATTENTION, 0); pBuf->action = cancel_disband_unit_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -914,8 +918,10 @@ void popup_unit_disband_dlg(struct unit *pUnit, bool city) add_to_gui_list(ID_BUTTON, pBuf); if (unit_disband_result) { - pBuf = create_themeicon_button_from_chars(current_theme->OK_Icon, pWindow->dst, - _("Disband"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->OK_Icon, + pWindow->dst, + _("Disband"), + FONTO_ATTENTION, 0); pBuf->action = ok_disband_unit_window_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1079,8 +1085,8 @@ void unit_select_dialog_popup(struct tile *ptile) is_unit_move_blocked = TRUE; pUnit_Select_Dlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - 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); @@ -1094,11 +1100,11 @@ void unit_select_dialog_popup(struct tile *ptile) area = pWindow->area; /* ---------- */ - /* create exit button */ + /* Create 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pBuf->action = exit_unit_select_callback; set_wstate(pBuf, FC_WS_NORMAL); pBuf->key = SDLK_ESCAPE; @@ -1310,7 +1316,9 @@ 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; @@ -1322,7 +1330,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; pBuf = create_iconlabel(pSurf, pWindow->dst, pstr, 0); @@ -1347,11 +1356,11 @@ static void popup_terrain_info_dialog(SDL_Surface *pDest, struct tile *ptile) pBuf->size.x = area.x + adj_size(10); pBuf->size.y = area.y; - /* exit icon */ + /* Exit icon */ 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pBuf->size.x = area.x + area.w - pBuf->size.w - 1; pBuf->size.y = pWindow->size.y + adj_size(2); pBuf->action = exit_terrain_info_dialog_callback; @@ -1680,7 +1689,7 @@ void popup_advanced_terrain_dialog(struct tile *ptile, Uint16 pos_x, Uint16 pos_ pCont->id0 = index_to_map_pos_x(tile_index(ptile)); pCont->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); @@ -1694,11 +1703,11 @@ void popup_advanced_terrain_dialog(struct tile *ptile, Uint16 pos_x, Uint16 pos_ 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += pBuf->size.w + adj_size(10); pBuf->action = exit_advanced_terrain_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -2238,8 +2247,8 @@ void popup_pillage_dialog(struct unit *pUnit, bv_extras extras) is_unit_move_blocked = TRUE; pPillage_Dlg = fc_calloc(1, sizeof(struct SMALL_DLG)); - /* 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); @@ -2255,11 +2264,11 @@ void popup_pillage_dialog(struct unit *pUnit, bv_extras extras) area.h = MAX(area.h, adj_size(2)); /* ---------- */ - /* 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += pBuf->size.w + adj_size(10); pBuf->action = exit_pillage_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -2404,7 +2413,8 @@ void popup_government_dialog(void) pGov_Dlg = fc_calloc(1, sizeof(struct SMALL_DLG)); /* 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); @@ -2423,9 +2433,10 @@ void popup_government_dialog(void) } if (can_change_to_government(client.conn.playing, pGov)) { - pstr = create_utf8_from_char(government_name_translation(pGov), adj_font(12)); - pGov_Button = - create_icon_button(get_government_surface(pGov), pWindow->dst, pstr, 0); + pstr = create_utf8_from_char_fonto(government_name_translation(pGov), + FONTO_ATTENTION); + pGov_Button + = create_icon_button(get_government_surface(pGov), pWindow->dst, pstr, 0); pGov_Button->action = government_dlg_callback; max_w = MAX(max_w, pGov_Button->size.w); @@ -2834,7 +2845,7 @@ static int nation_button_callback(struct widget *pNationButton) redraw_group(pNationDlg->pBeginWidgetList, pNationDlg->pEndWidgetList, 0); widget_flush(pNationDlg->pEndWidgetList); } else { - /* pop up nation description */ + /* Pop up nation description */ struct widget *pWindow, *pOK_Button; utf8_str *pstr; SDL_Surface *pText; @@ -2847,8 +2858,8 @@ static int nation_button_callback(struct widget *pNationButton) if (!pHelpDlg) { pHelpDlg = fc_calloc(1, sizeof(struct SMALL_DLG)); - 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); @@ -2880,7 +2891,7 @@ static int nation_button_callback(struct widget *pNationButton) 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); @@ -2888,7 +2899,7 @@ static int nation_button_callback(struct widget *pNationButton) FREEUTF8STR(pstr); - /* create window background */ + /* Create window background */ area.w = MAX(area.w, pText->w + adj_size(20)); area.w = MAX(area.w, pOK_Button->size.w + adj_size(20)); area.h = MAX(area.h, adj_size(9) + pText->h @@ -3060,8 +3071,9 @@ void popup_races_dialog(struct player *pplayer) pNationDlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - /* create window widget */ - pstr = create_utf8_from_char(_("What nation will you be?"), adj_font(12)); + /* Create window widget */ + 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); @@ -3084,7 +3096,7 @@ void popup_races_dialog(struct player *pplayer) 0, 0, pMain_Bg->w - 1, pMain_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}; @@ -3100,7 +3112,7 @@ void popup_races_dialog(struct player *pplayer) pTmp_Surf = crop_rect_from_surface(pMain_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); pText_Name = create_text_surf_smaller_than_w(pstr, pTmp_Surf->w - adj_size(4)); dst.x = (pTmp_Surf->w - pTmp_Surf_zoomed->w) / 2; @@ -3153,7 +3165,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); @@ -3162,8 +3175,9 @@ void popup_races_dialog(struct player *pplayer) poption = optset_option_by_name(server_optset, "nationset"); pSetup->set = nation_set_by_setting_value(option_str_get(poption)); - natset_str = create_utf8_from_char(nation_set_name_translation(pSetup->set), - adj_font(12)); + natset_str + = create_utf8_from_char_fonto(nation_set_name_translation(pSetup->set), + FONTO_ATTENTION); change_ptsize_utf8(natset_str, adj_font(24)); pWidget = create_iconlabel(NULL, pWindow->dst, natset_str, 0); @@ -3281,19 +3295,21 @@ void popup_races_dialog(struct player *pplayer) pLast_City_Style = pWidget; /* ---------------------------------------------------------- */ - /* create Cancel button */ - pWidget = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, - pWindow->dst, _("Cancel"), - adj_font(12), 0); + /* Create Cancel button */ + pWidget + = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, + pWindow->dst, _("Cancel"), + 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); + /* Create OK button */ + 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); @@ -3439,7 +3455,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 b66cc5213d..0d7161bafe 100644 --- a/client/gui-sdl2/diplodlg.c +++ b/client/gui-sdl2/diplodlg.c @@ -478,7 +478,8 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, pCont->id0 = player_number(pPlayer0); pCont->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); @@ -498,8 +499,9 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, /* Pacts. */ if (pPlayer0 == client.conn.playing && DS_ALLIANCE != type) { - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Pacts"), adj_font(12), WF_RESTORE_BACKGROUND); + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Pacts"), FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); width = pBuf->size.w; height = pBuf->size.h; @@ -508,8 +510,9 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, if (type != DS_CEASEFIRE && type != DS_TEAM) { fc_snprintf(cBuf, sizeof(cBuf), " %s", Q_("?diplomatic_state:Cease-fire")); - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - cBuf, adj_font(12), (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + cBuf, FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, pBuf->size.w); height = MAX(height, pBuf->size.h); @@ -523,8 +526,8 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, if (type != DS_PEACE && type != DS_TEAM) { fc_snprintf(cBuf, sizeof(cBuf), " %s", Q_("?diplomatic_state:Peace")); - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - cBuf, adj_font(12), + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + cBuf, FONTO_ATTENTION, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, pBuf->size.w); @@ -539,8 +542,8 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, if (pplayer_can_make_treaty(pPlayer0, pPlayer1, DS_ALLIANCE) == DIPL_OK) { fc_snprintf(cBuf, sizeof(cBuf), " %s", Q_("?diplomatic_state:Alliance")); - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - cBuf, adj_font(12), + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + cBuf, FONTO_ATTENTION, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, pBuf->size.w); @@ -555,8 +558,9 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, /* ---------------------------- */ if (!gives_shared_vision(pPlayer0, pPlayer1)) { - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Give shared vision"), adj_font(12), + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Give shared vision"), + FONTO_ATTENTION, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, pBuf->size.w); @@ -568,10 +572,12 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, count++; /* ---------------------------- */ - /* you can't give maps if you give shared vision */ - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Maps"), adj_font(12), WF_RESTORE_BACKGROUND); - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); + /* You can't give maps if you give shared vision */ + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Maps"), FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); width = MAX(width, pBuf->size.w); height = MAX(height, pBuf->size.h); add_to_gui_list(ID_LABEL, pBuf); @@ -580,9 +586,11 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, /* ----- */ fc_snprintf(cBuf, sizeof(cBuf), " %s", _("World map")); - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - cBuf, adj_font(12), (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + cBuf, FONTO_ATTENTION, + (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, pBuf->size.w); height = MAX(height, pBuf->size.h); pBuf->action = maps_callback; @@ -594,10 +602,11 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, /* ----- */ fc_snprintf(cBuf, sizeof(cBuf), " %s", _("Sea map")); - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - cBuf, adj_font(12), + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + cBuf, FONTO_ATTENTION, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, pBuf->size.w); height = MAX(height, pBuf->size.h); pBuf->action = maps_callback; @@ -609,8 +618,8 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, /* Don't take in account the embassy effects. */ if (!player_has_real_embassy(pPlayer1, pPlayer0)) { - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Give embassy"), adj_font(12), + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Give embassy"), FONTO_ATTENTION, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, pBuf->size.w); @@ -627,9 +636,11 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, pCont->value = pPlayer0->economic.gold; fc_snprintf(cBuf, sizeof(cBuf), _("Gold(max %d)"), pPlayer0->economic.gold); - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - cBuf, adj_font(12), WF_RESTORE_BACKGROUND); - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + cBuf, FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); width = MAX(width, pBuf->size.w); height = MAX(height, pBuf->size.h); add_to_gui_list(ID_LABEL, pBuf); @@ -662,10 +673,11 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, || research_invention_state(presearch1, i) == TECH_PREREQS_KNOWN)) { - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Advances"), adj_font(12), - WF_RESTORE_BACKGROUND); - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Advances"), FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); width = MAX(width, pBuf->size.w); height = MAX(height, pBuf->size.h); add_to_gui_list(ID_LABEL, pBuf); @@ -674,9 +686,11 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, fc_snprintf(cBuf, sizeof(cBuf), " %s", advance_name_translation(advance_by_number(i))); - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, cBuf, adj_font(12), + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, cBuf, + FONTO_ATTENTION, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, pBuf->size.w); height = MAX(height, pBuf->size.h); pBuf->action = techs_callback; @@ -701,9 +715,11 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, fc_snprintf(cBuf, sizeof(cBuf), " %s", advance_name_translation(advance_by_number(i))); - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, cBuf, adj_font(12), + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, cBuf, + FONTO_ATTENTION, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, pBuf->size.w); height = MAX(height, pBuf->size.h); pBuf->action = techs_callback; @@ -741,10 +757,11 @@ static struct ADVANCED_DLG *popup_diplomatic_objects(struct player *pPlayer0, } if (i > 0) { - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Cities"), adj_font(12), - WF_RESTORE_BACKGROUND); - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Cities"), FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_HEADING_TEXT); pBuf->string_utf8->style &= ~SF_CENTER; width = MAX(width, pBuf->size.w); height = MAX(height, pBuf->size.h); @@ -756,9 +773,11 @@ static struct ADVANCED_DLG *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])); - pBuf = create_iconlabel_from_chars(NULL, pWindow->dst, cBuf, adj_font(12), + pBuf = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, cBuf, + FONTO_ATTENTION, (WF_RESTORE_BACKGROUND|WF_DRAW_TEXT_LABEL_WITH_SPACE)); - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); width = MAX(width, pBuf->size.w); height = MAX(height, pBuf->size.h); pBuf->data.cont = pCont; @@ -884,7 +903,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); @@ -898,7 +917,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); @@ -914,7 +934,8 @@ static void update_diplomacy_dialog(struct diplomacy_dialog *pdialog) add_to_gui_list(ID_ICON, pBuf); - 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); @@ -932,8 +953,8 @@ static void update_diplomacy_dialog(struct diplomacy_dialog *pdialog) pBuf = create_themeicon(current_theme->CANCEL_PACT_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("Cancel meeting"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Cancel meeting"), + FONTO_ATTENTION); pBuf->action = cancel_meeting_callback; pBuf->data.cont = pCont; set_wstate(pBuf, FC_WS_NORMAL); @@ -943,8 +964,8 @@ static void update_diplomacy_dialog(struct diplomacy_dialog *pdialog) pBuf = create_themeicon(current_theme->OK_PACT_Icon, pWindow->dst, WF_FREE_DATA | WF_WIDGET_HAS_INFO_LABEL |WF_RESTORE_BACKGROUND); - pBuf->info_label = create_utf8_from_char(_("Accept treaty"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Accept treaty"), + FONTO_ATTENTION); pBuf->action = accept_treaty_callback; pBuf->data.cont = pCont; set_wstate(pBuf, FC_WS_NORMAL); @@ -1078,7 +1099,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)); @@ -1376,7 +1397,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); @@ -1403,9 +1424,9 @@ static void popup_war_dialog(struct player *pPlayer) area.w = MAX(area.w, pText->w); area.h += pText->h + adj_size(10); - pBuf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, - pWindow->dst, _("No"), - adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->CANCEL_Icon, + pWindow->dst, _("No"), + FONTO_ATTENTION, 0); pBuf->action = cancel_sdip_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1414,8 +1435,10 @@ static void popup_war_dialog(struct player *pPlayer) add_to_gui_list(ID_BUTTON, pBuf); - pBuf = create_themeicon_button_from_chars(current_theme->OK_Icon, pWindow->dst, - _("Yes"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->OK_Icon, + pWindow->dst, + _("Yes"), + FONTO_ATTENTION, 0); pBuf->action = cancel_pact_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1510,8 +1533,8 @@ void popup_diplomacy_dialog(struct player *pPlayer) pSDip_Dlg = fc_calloc(1, sizeof(struct SMALL_DLG)); - 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); @@ -1556,13 +1579,14 @@ void popup_diplomacy_dialog(struct player *pPlayer) } /* Cancel treaty */ - pBuf = create_themeicon_button_from_chars(current_theme->UNITS2_Icon, - pWindow->dst, cBuf, - adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->UNITS2_Icon, + pWindow->dst, cBuf, + FONTO_ATTENTION, 0); pBuf->action = cancel_pact_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); pBuf->data.player = pPlayer; pBuf->key = SDLK_c; add_to_gui_list(ID_BUTTON, pBuf); @@ -1576,16 +1600,18 @@ void popup_diplomacy_dialog(struct player *pPlayer) shared = gives_shared_vision(client.conn.playing, pPlayer); if (shared) { - /* shared vision */ - pBuf = create_themeicon_button_from_chars(current_theme->UNITS2_Icon, - pWindow->dst, _("Withdraw vision"), - adj_font(12), 0); + /* Shared vision */ + pBuf = create_themeicon_button_from_chars_fonto(current_theme->UNITS2_Icon, + pWindow->dst, + _("Withdraw vision"), + FONTO_ATTENTION, 0); pBuf->action = withdraw_vision_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); pBuf->data.player = pPlayer; pBuf->key = SDLK_w; - pBuf->string_utf8->fgcol = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); + pBuf->string_utf8->fgcol + = *get_theme_color(COLOR_THEME_DIPLODLG_MEETING_TEXT); add_to_gui_list(ID_BUTTON, pBuf); pBuf->size.w = MAX(pBuf->next->size.w, pBuf->size.w); pBuf->next->size.w = pBuf->size.w; @@ -1594,11 +1620,11 @@ void popup_diplomacy_dialog(struct player *pPlayer) buttons++; } - /* meet */ - pBuf = create_themeicon_button_from_chars(current_theme->PLAYERS_Icon, - pWindow->dst, - _("Call Diplomatic Meeting"), - adj_font(12), 0); + /* Meet */ + pBuf = create_themeicon_button_from_chars_fonto(current_theme->PLAYERS_Icon, + pWindow->dst, + _("Call Diplomatic Meeting"), + FONTO_ATTENTION, 0); pBuf->action = call_meeting_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1612,9 +1638,10 @@ void popup_diplomacy_dialog(struct player *pPlayer) button_h = MAX(button_h , pBuf->size.h); buttons++; - pBuf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, - pWindow->dst, _("Send him back"), - adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->CANCEL_Icon, + pWindow->dst, + _("Send him back"), + FONTO_ATTENTION, 0); pBuf->action = cancel_sdip_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); diff --git a/client/gui-sdl2/finddlg.c b/client/gui-sdl2/finddlg.c index 086fb835e6..2f99db951f 100644 --- a/client/gui-sdl2/finddlg.c +++ b/client/gui-sdl2/finddlg.c @@ -146,7 +146,7 @@ void popup_find_dialog(void) pFind_City_Dlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - 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); @@ -160,12 +160,12 @@ void popup_find_dialog(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 | WF_FREE_DATA); - pBuf->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w = MAX(area.w, pBuf->size.w + adj_size(10)); pBuf->action = exit_find_city_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); diff --git a/client/gui-sdl2/gotodlg.c b/client/gui-sdl2/gotodlg.c index f5e5b40b41..bebec3be97 100644 --- a/client/gui-sdl2/gotodlg.c +++ b/client/gui-sdl2/gotodlg.c @@ -158,7 +158,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; } @@ -166,7 +166,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)) { @@ -233,7 +233,7 @@ static void update_goto_dialog(void) hide_scrollbar(pGotoDlg->pScroll); } - /* redraw */ + /* Redraw */ redraw_group(pGotoDlg->pBeginWidgetList, pGotoDlg->pEndWidgetList, 0); widget_flush(pGotoDlg->pEndWidgetList); } @@ -257,7 +257,8 @@ static void popup_goto_airlift_dialog(void) pGotoDlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - 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); @@ -271,11 +272,11 @@ static void popup_goto_airlift_dialog(void) area = pWindow->area; /* ---------- */ - /* create exit button */ + /* Create 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pBuf->action = exit_goto_dialog_callback; set_wstate(pBuf, FC_WS_NORMAL); pBuf->key = SDLK_ESCAPE; @@ -305,9 +306,9 @@ static void popup_goto_airlift_dialog(void) | WF_WIDGET_HAS_INFO_LABEL); set_new_checkbox_theme(pBuf, pEnabled, pDisabled); - pBuf->info_label = - create_utf8_from_char(nation_adjective_for_player(pPlayer), - adj_font(12)); + pBuf->info_label + = create_utf8_from_char_fonto(nation_adjective_for_player(pPlayer), + FONTO_ATTENTION); pBuf->info_label->style &= ~SF_CENTER; set_wstate(pBuf, FC_WS_NORMAL); diff --git a/client/gui-sdl2/gui_string.c b/client/gui-sdl2/gui_string.c index 10c1ea2669..a2b4b43f5c 100644 --- a/client/gui-sdl2/gui_string.c +++ b/client/gui-sdl2/gui_string.c @@ -162,10 +162,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 85b9ea7e35..54f9f65d0b 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 434b28a42e..fe804bdd31 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) pStore = 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); @@ -261,8 +262,9 @@ void popup_impr_info(Impr_type_id impr) pCloseButton = create_themeicon(current_theme->Small_CANCEL_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pCloseButton->info_label = - create_utf8_from_char(_("Close Dialog (Esc)"), adj_font(12)); + pCloseButton->info_label + = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pCloseButton->action = exit_help_dlg_callback; set_wstate(pCloseButton, FC_WS_NORMAL); pCloseButton->key = SDLK_ESCAPE; @@ -380,16 +382,18 @@ void popup_impr_info(Impr_type_id impr) if (!improvement_has_flag(pImpr_type, IF_GOLD)) { sprintf(buffer, "%s %d", _("Cost:"), impr_build_shield_cost(pImpr_type)); - pCostLabel = create_iconlabel_from_chars(NULL, pWindow->dst, - buffer, adj_font(12), 0); + pCostLabel = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + buffer, + FONTO_ATTENTION, 0); pCostLabel->ID = ID_LABEL; DownAdd(pCostLabel, pDock); pDock = pCostLabel; if (!is_wonder(pImpr_type)) { sprintf(buffer, "%s %d", _("Upkeep:"), pImpr_type->upkeep); - pUpkeepLabel = create_iconlabel_from_chars(NULL, pWindow->dst, - buffer, adj_font(12), 0); + pUpkeepLabel = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + buffer, + FONTO_ATTENTION, 0); pUpkeepLabel->ID = ID_LABEL; DownAdd(pUpkeepLabel, pDock); pDock = pUpkeepLabel; @@ -397,9 +401,9 @@ void popup_impr_info(Impr_type_id impr) } /* Requirement */ - pRequirementLabel = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Requirement:"), - adj_font(12), 0); + pRequirementLabel = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Requirement:"), + FONTO_ATTENTION, 0); pRequirementLabel->ID = ID_LABEL; DownAdd(pRequirementLabel, pDock); pDock = pRequirementLabel; @@ -412,10 +416,12 @@ void popup_impr_info(Impr_type_id impr) if (!preq->present) { continue; } - pRequirementLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst, + pRequirementLabel2 + = 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 +434,9 @@ void popup_impr_info(Impr_type_id impr) } requirement_vector_iterate_end; if (pRequirementLabel2 == NULL) { - pRequirementLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst, - Q_("?req:None"), - adj_font(12), 0); + pRequirementLabel2 = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + Q_("?req:None"), + FONTO_ATTENTION, 0); pRequirementLabel2->ID = ID_LABEL; } @@ -439,9 +445,9 @@ void popup_impr_info(Impr_type_id impr) pStore->pRequirementButton = pRequirementLabel2; /* Obsolete by */ - pObsoleteByLabel = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Obsolete by:"), - adj_font(12), 0); + pObsoleteByLabel = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Obsolete by:"), + FONTO_ATTENTION, 0); pObsoleteByLabel->ID = ID_LABEL; DownAdd(pObsoleteByLabel, pDock); pDock = pObsoleteByLabel; @@ -455,15 +461,19 @@ void popup_impr_info(Impr_type_id impr) } requirement_vector_iterate_end; if (obsTech == NULL) { - pObsoleteByLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Never"), adj_font(12), 0); + pObsoleteByLabel2 = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Never"), + FONTO_ATTENTION, 0); pObsoleteByLabel2->ID = ID_LABEL; } else { - pObsoleteByLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst, - advance_name_translation(obsTech), - adj_font(12), WF_RESTORE_BACKGROUND); + pObsoleteByLabel2 + = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + advance_name_translation(obsTech), + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); pObsoleteByLabel2->ID = MAX_ID - advance_number(obsTech); - pObsoleteByLabel2->string_utf8->fgcol = *get_tech_color(advance_number(obsTech)); + pObsoleteByLabel2->string_utf8->fgcol + = *get_tech_color(advance_number(obsTech)); pObsoleteByLabel2->action = change_tech_callback; set_wstate(pObsoleteByLabel2, FC_WS_NORMAL); } @@ -477,7 +487,7 @@ void popup_impr_info(Impr_type_id impr) buffer[0] = '\0'; 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)); pHelptextLabel = create_iconlabel(NULL, pWindow->dst, bstr, 0); @@ -648,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 (!pHelpDlg) { SDL_Surface *pBackgroundTmpl, *pBackground, *pText, *pIcon; SDL_Rect dst; @@ -656,12 +666,12 @@ void popup_unit_info(Unit_type_id type_id) current_help_dlg = HELP_UNIT; created = TRUE; - /* create dialog */ + /* Create dialog */ pHelpDlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); pStore = 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); @@ -676,12 +686,13 @@ void popup_unit_info(Unit_type_id type_id) /* ------------------ */ - /* close button */ - pCloseButton = create_themeicon(current_theme->Small_CANCEL_Icon, pWindow->dst, + /* Close button */ + pCloseButton = create_themeicon(current_theme->Small_CANCEL_Icon, + pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pCloseButton->info_label = - create_utf8_from_char(_("Close Dialog (Esc)"), adj_font(12)); + pCloseButton->info_label + = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), FONTO_ATTENTION); pCloseButton->action = exit_help_dlg_callback; set_wstate(pCloseButton, FC_WS_NORMAL); pCloseButton->key = SDLK_ESCAPE; @@ -840,31 +851,33 @@ void popup_unit_info(Unit_type_id type_id) _("FirePower:"), pUnitType->firepower, _("Hitpoints:"), pUnitType->hp); - pUnitInfoLabel = create_iconlabel_from_chars(NULL, pWindow->dst, buf, - adj_font(12), 0); + pUnitInfoLabel = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, buf, + FONTO_ATTENTION, 0); pUnitInfoLabel->ID = ID_LABEL; DownAdd(pUnitInfoLabel, pDock); pDock = pUnitInfoLabel; } - /* requirement */ - pRequirementLabel = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Requirement:"), - adj_font(12), 0); + /* Requirement */ + pRequirementLabel = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Requirement:"), + FONTO_ATTENTION, 0); pRequirementLabel->ID = ID_LABEL; DownAdd(pRequirementLabel, pDock); pDock = pRequirementLabel; if (A_NEVER == pUnitType->require_advance || advance_by_number(A_NONE) == pUnitType->require_advance) { - pRequirementLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst, - Q_("?tech:None"), adj_font(12), 0); + pRequirementLabel2 = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + Q_("?tech:None"), + FONTO_ATTENTION, 0); pRequirementLabel2->ID = ID_LABEL; } else { - pRequirementLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst, + pRequirementLabel2 + = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, advance_name_translation(pUnitType->require_advance), - adj_font(12), - WF_RESTORE_BACKGROUND); + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); pRequirementLabel2->ID = MAX_ID - advance_number(pUnitType->require_advance); pRequirementLabel2->string_utf8->fgcol = *get_tech_color(advance_number(pUnitType->require_advance)); pRequirementLabel2->action = change_tech_callback; @@ -874,27 +887,28 @@ void popup_unit_info(Unit_type_id type_id) pDock = pRequirementLabel2; pStore->pRequirementButton = pRequirementLabel2; - /* obsolete by */ - pObsoleteByLabel = create_iconlabel_from_chars(NULL, pWindow->dst, - _("Obsolete by:"), - adj_font(12), 0); + /* Obsolete by */ + pObsoleteByLabel = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + _("Obsolete by:"), + FONTO_ATTENTION, 0); pObsoleteByLabel->ID = ID_LABEL; DownAdd(pObsoleteByLabel, pDock); pDock = pObsoleteByLabel; if (pUnitType->obsoleted_by == U_NOT_OBSOLETED) { - pObsoleteByLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst, - Q_("?utype:None"), - adj_font(12), 0); + pObsoleteByLabel2 = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, + Q_("?utype:None"), + FONTO_ATTENTION, 0); pObsoleteByLabel2->ID = ID_LABEL; } else { struct unit_type *utype = pUnitType->obsoleted_by; - pObsoleteByLabel2 = create_iconlabel_from_chars(NULL, pWindow->dst, + pObsoleteByLabel2 = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, utype_name_translation(utype), - adj_font(12), - WF_RESTORE_BACKGROUND); - pObsoleteByLabel2->string_utf8->fgcol = *get_tech_color(advance_number(utype->require_advance)); + FONTO_ATTENTION, + WF_RESTORE_BACKGROUND); + pObsoleteByLabel2->string_utf8->fgcol + = *get_tech_color(advance_number(utype->require_advance)); pObsoleteByLabel2->ID = MAX_ID - utype_number(pUnitType->obsoleted_by); pObsoleteByLabel2->action = change_unit_callback; set_wstate(pObsoleteByLabel2, FC_WS_NORMAL); @@ -909,7 +923,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)); pHelptextLabel = create_iconlabel(NULL, pWindow->dst, ustr, 0); @@ -1076,7 +1090,7 @@ static void redraw_tech_info_dlg(void) if (pStore->pSub_Targets[0]) { int i; - change_ptsize_utf8(pstr, adj_font(12)); + change_fonto_utf8(pstr, FONTO_ATTENTION); copy_chars_to_utf8_str(pstr, _("( with ")); pText0 = create_text_surf_from_utf8(pstr); @@ -1149,10 +1163,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, + pWidget + = create_iconlabel_from_chars_fonto(NULL, pWindow->dst, advance_name_translation(advance_by_number(aidx)), - adj_font(12), - WF_RESTORE_BACKGROUND); + 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); @@ -1182,10 +1197,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; @@ -1281,7 +1297,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); @@ -1917,21 +1933,22 @@ void popup_tech_info(Tech_type_id tech) current_help_dlg = HELP_TECH; created = TRUE; - /* create dialog */ + /* Create dialog */ pHelpDlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); pStore = fc_calloc(1, sizeof(struct TECHS_BUTTONS)); pStore->show_tree = FALSE; pStore->show_full_tree = FALSE; - /* create window */ - title = create_utf8_from_char(_("Help : Advances Tree"), adj_font(12)); + /* Create window */ + 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 *)pStore; 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 +1962,8 @@ void popup_tech_info(Tech_type_id tech) pCloseButton = create_themeicon(current_theme->Small_CANCEL_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pCloseButton->info_label = - create_utf8_from_char(_("Close Dialog (Esc)"), adj_font(12)); + pCloseButton->info_label + = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), FONTO_ATTENTION); pCloseButton->action = exit_help_dlg_callback; set_wstate(pCloseButton, FC_WS_NORMAL); pCloseButton->key = SDLK_ESCAPE; diff --git a/client/gui-sdl2/inteldlg.c b/client/gui-sdl2/inteldlg.c index 2520245ac6..515bbd0252 100644 --- a/client/gui-sdl2/inteldlg.c +++ b/client/gui-sdl2/inteldlg.c @@ -247,7 +247,8 @@ void update_intel_dialog(struct player *p) pdialog->pdialog->pEndWidgetList); } - 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); @@ -262,12 +263,12 @@ void update_intel_dialog(struct player *p) 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w = MAX(area.w, pBuf->size.w + adj_size(10)); pBuf->action = exit_intel_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -296,7 +297,7 @@ void update_intel_dialog(struct player *p) fc_snprintf(cBuf, sizeof(cBuf), _("Intelligence Information about the %s Spaceship"), nation_adjective_for_player(p)); - pBuf->info_label = create_utf8_from_char(cBuf, adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(cBuf, FONTO_ATTENTION); add_to_gui_list(ID_ICON, pBuf); @@ -393,9 +394,10 @@ void update_intel_dialog(struct player *p) pBuf->action = tech_callback; set_wstate(pBuf, FC_WS_NORMAL); - pBuf->info_label = - create_utf8_from_char(advance_name_translation - (advance_by_number(i)), adj_font(12)); + pBuf->info_label + = create_utf8_from_char_fonto(advance_name_translation + (advance_by_number(i)), + FONTO_ATTENTION); add_to_gui_list(ID_ICON, pBuf); diff --git a/client/gui-sdl2/mapctrl.c b/client/gui-sdl2/mapctrl.c index bd9c375d45..77156c75ca 100644 --- a/client/gui-sdl2/mapctrl.c +++ b/client/gui-sdl2/mapctrl.c @@ -714,8 +714,8 @@ static void popup_minimap_scale_dialog(void) pScale_MiniMap_Dlg = fc_calloc(1, sizeof(struct SMALL_DLG)); - /* 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; @@ -726,7 +726,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); pText1 = create_text_surf_from_utf8(pstr); area.w = MAX(area.w, pText1->w + adj_size(30)); @@ -774,7 +774,7 @@ static void popup_minimap_scale_dialog(void) area.w = MAX(area.w , pBuf->size.w * 2 + pBuf->next->size.w + adj_size(20)); /* ------------ */ - pstr = create_utf8_from_char(_("Exit"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Exit"), FONTO_ATTENTION); pBuf = create_themeicon_button(current_theme->CANCEL_Icon, pWindow->dst, pstr, 0); pBuf->action = popdown_scale_minimap_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1100,8 +1100,8 @@ static void popup_unitinfo_scale_dialog(void) pScale_UnitInfo_Dlg = fc_calloc(1, sizeof(struct SMALL_DLG)); - /* 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; @@ -1111,7 +1111,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); pText1 = create_text_surf_from_utf8(pstr); area.w = MAX(area.w, pText1->w + adj_size(30)); area.h += MAX(adj_size(20), pText1->h + adj_size(4)); @@ -1147,7 +1147,7 @@ static void popup_unitinfo_scale_dialog(void) area.w = MAX(area.w , pBuf->size.w * 2 + adj_size(20)); /* ------------ */ - pstr = create_utf8_from_char(_("Exit"), adj_font(12)); + pstr = create_utf8_from_char_fonto(_("Exit"), FONTO_ATTENTION); pBuf = create_themeicon_button(current_theme->CANCEL_Icon, pWindow->dst, pstr, 0); pBuf->action = popdown_scale_unitinfo_dlg_callback; @@ -1472,13 +1472,13 @@ void popup_unitinfo_window(void) pUnitInfo_Dlg->pEndWidgetList = pUnits_Info_Window; pUnits_Info_Window->private_data.adv_dlg = pUnitInfo_Dlg; - /* economy button */ + /* Economy button */ pWidget = create_icon2(get_tax_surface(O_GOLD), pUnits_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; @@ -1486,14 +1486,14 @@ void popup_unitinfo_window(void) pTax_Button = pWidget; - /* research button */ + /* Research button */ pWidget = create_icon2(adj_surf(GET_SURF(client_research_sprite())), pUnits_Info_Window->dst, WF_FREE_GFX | WF_WIDGET_HAS_INFO_LABEL | 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; @@ -1501,13 +1501,13 @@ void popup_unitinfo_window(void) pResearch_Button = pWidget; - /* revolution button */ + /* Revolution button */ pWidget = create_icon2(adj_surf(GET_SURF(client_government_sprite())), pUnits_Info_Window->dst, WF_FREE_GFX | WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND | WF_FREE_THEME); fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Revolution"), "Ctrl+Shift+R"); - 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_r; pWidget->mod = KMOD_CTRL | KMOD_SHIFT; @@ -1528,8 +1528,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; @@ -1661,12 +1662,12 @@ void popup_minimap_window(void) pMiniMap_Window = pWindow; pMiniMap_Dlg->pEndWidgetList = pMiniMap_Window; - /* new turn button */ + /* New turn button */ pWidget = create_themeicon(current_theme->NEW_TURN_Icon, pMiniMap_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; @@ -1681,19 +1682,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->FindCity_Icon, pMiniMap_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; @@ -1703,36 +1704,36 @@ void popup_minimap_window(void) pFind_City_Button = pWidget; - /* units button */ + /* Units button */ pWidget = create_themeicon(current_theme->UNITS2_Icon, pMiniMap_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, pMiniMap_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 */ pOptions_Button = create_themeicon(current_theme->Options_Icon, pMiniMap_Window->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Options"), "Esc"); - pOptions_Button->info_label = create_utf8_from_char(buf, adj_font(12)); + pOptions_Button->info_label = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); pOptions_Button->action = optiondlg_callback; pOptions_Button->key = SDLK_ESCAPE; @@ -1753,8 +1754,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); @@ -2754,8 +2755,8 @@ void popup_newcity_dialog(struct unit *pUnit, const char *pSuggestname) pNewCity_Dlg = fc_calloc(1, sizeof(struct SMALL_DLG)); - /* create window */ - pstr = create_utf8_from_char(_("Build City"), adj_font(12)); + /* Create window */ + pstr = create_utf8_from_char_fonto(_("Build City"), FONTO_ATTENTION); pstr->style |= TTF_STYLE_BOLD; pWindow = create_window_skeleton(NULL, pstr, 0); pWindow->action = move_new_city_dlg_callback; @@ -2796,7 +2797,8 @@ void popup_newcity_dialog(struct unit *pUnit, const char *pSuggestname) area.h += pLabel->size.h; - pEdit = create_edit(NULL, pWindow->dst, create_utf8_from_char(pSuggestname, adj_font(12)), + pEdit = create_edit(NULL, pWindow->dst, + create_utf8_from_char_fonto(pSuggestname, FONTO_ATTENTION), (pOK_Button->size.w + pCancel_Button->size.w + adj_size(15)), WF_RESTORE_BACKGROUND); pEdit->action = newcity_name_edit_callback; @@ -2812,7 +2814,7 @@ void popup_newcity_dialog(struct unit *pUnit, const char *pSuggestname) pEdit->size.w = area.w - adj_size(20); - /* create window background */ + /* Create window background */ pBackground = theme_get_background(theme, BACKGROUND_NEWCITYDLG); if (resize_window(pWindow, pBackground, NULL, (pWindow->size.w - pWindow->area.w) + area.w, @@ -2822,7 +2824,7 @@ void popup_newcity_dialog(struct unit *pUnit, const char *pSuggestname) area = pWindow->area; - /* set start positions */ + /* Set start positions */ widget_set_position(pWindow, (main_window_width() - pWindow->size.w) / 2, (main_window_height() - pWindow->size.h) / 2); diff --git a/client/gui-sdl2/mapview.c b/client/gui-sdl2/mapview.c index eaf92eab8d..8ebbbd0809 100644 --- a/client/gui-sdl2/mapview.c +++ b/client/gui-sdl2/mapview.c @@ -532,7 +532,7 @@ void redraw_unit_info_label(struct unit_list *punitlist) if (SDL_Client_Flags & CF_UNITINFO_SHOWN) { pInfo_Window = get_unit_info_window_widget(); - /* blit theme surface */ + /* Blit theme surface */ widget_redraw(pInfo_Window); if (pUnit) { @@ -544,7 +544,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}; pName = create_text_surf_from_utf8(pstr); diff --git a/client/gui-sdl2/messagewin.c b/client/gui-sdl2/messagewin.c index 75fa74ea5a..4cdedc80f1 100644 --- a/client/gui-sdl2/messagewin.c +++ b/client/gui-sdl2/messagewin.c @@ -254,8 +254,8 @@ void meswin_dialog_popup(bool raise) pMsg_Dlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - /* 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 03efdf73c3..f28f454a75 100644 --- a/client/gui-sdl2/optiondlg.c +++ b/client/gui-sdl2/optiondlg.c @@ -512,12 +512,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); @@ -535,9 +536,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; @@ -546,15 +548,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; @@ -570,10 +574,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; @@ -589,9 +594,10 @@ 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; @@ -607,10 +613,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); @@ -773,7 +780,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); @@ -784,11 +791,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; @@ -796,18 +804,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); @@ -816,8 +824,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); @@ -826,17 +835,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); @@ -845,8 +855,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) { @@ -856,8 +867,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) { @@ -867,8 +879,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); @@ -962,9 +975,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)); @@ -1008,8 +1021,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); @@ -1135,10 +1148,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); @@ -1213,10 +1227,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; @@ -1230,9 +1244,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; @@ -1360,7 +1375,8 @@ void init_options_button(void) | WF_RESTORE_BACKGROUND); pOptions_Button->action = optiondlg_callback; fc_snprintf(buf, sizeof(buf), "%s (%s)", _("Options"), "Esc"); - pOptions_Button->info_label = create_utf8_from_char(buf, adj_font(12)); + pOptions_Button->info_label + = create_utf8_from_char_fonto(buf, FONTO_ATTENTION); pOptions_Button->key = SDLK_ESCAPE; set_wflag(pOptions_Button, WF_HIDDEN); widget_set_position(pOptions_Button, adj_size(5), adj_size(5)); diff --git a/client/gui-sdl2/pages.c b/client/gui-sdl2/pages.c index d0e1192929..66e9e73ca3 100644 --- a/client/gui-sdl2/pages.c +++ b/client/gui-sdl2/pages.c @@ -157,10 +157,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; @@ -173,8 +173,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 719007a7eb..b01d95b87e 100644 --- a/client/gui-sdl2/plrdlg.c +++ b/client/gui-sdl2/plrdlg.c @@ -385,7 +385,8 @@ void popup_players_dialog(bool raise) pPlayers_Dlg = fc_calloc(1, sizeof(struct SMALL_DLG)); - 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); @@ -396,11 +397,11 @@ void popup_players_dialog(bool raise) add_to_gui_list(ID_WINDOW, pWindow); pPlayers_Dlg->pEndWidgetList = pWindow; /* ---------- */ - /* 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pBuf->action = exit_players_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); pBuf->key = SDLK_ESCAPE; @@ -683,7 +684,7 @@ void popup_players_nations_dialog(void) pShort_Players_Dlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); /* 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); @@ -697,11 +698,11 @@ void popup_players_nations_dialog(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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w = MAX(area.w, pBuf->size.w + adj_size(10)); pBuf->action = exit_players_nations_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); diff --git a/client/gui-sdl2/repodlgs.c b/client/gui-sdl2/repodlgs.c index 4a6ef05a35..a927cc8ca4 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); @@ -249,10 +250,10 @@ static int popup_upgrade_unit_callback(struct widget *pWidget) area.h += (pText->h + adj_size(10)); area.w = MAX(area.w, pText->w + adj_size(20)); - /* cancel button */ - pBuf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, - pWindow->dst, _("No"), - adj_font(12), 0); + /* Cancel button */ + pBuf = create_themeicon_button_from_chars_fonto(current_theme->CANCEL_Icon, + pWindow->dst, _("No"), + FONTO_ATTENTION, 0); pBuf->action = cancel_upgrade_unit_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -262,8 +263,10 @@ static int popup_upgrade_unit_callback(struct widget *pWidget) add_to_gui_list(ID_BUTTON, pBuf); if (value <= client.conn.playing->economic.gold) { - pBuf = create_themeicon_button_from_chars(current_theme->OK_Icon, pWindow->dst, - _("Yes"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->OK_Icon, + pWindow->dst, + _("Yes"), + FONTO_ATTENTION, 0); pBuf->action = ok_upgrade_unit_window_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -395,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); @@ -409,10 +412,11 @@ static void real_activeunits_report_dialog_update(struct units_entry *units, 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 (Esc)"), adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pBuf->action = exit_units_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); pBuf->key = SDLK_ESCAPE; @@ -490,8 +494,9 @@ static void real_activeunits_report_dialog_update(struct units_entry *units, hh = pBuf->size.h; add_to_gui_list(MAX_ID - utype_number(i), pBuf); - /* 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); pBuf = create_iconlabel(NULL, pWindow->dst, pstr, (WF_RESTORE_BACKGROUND | WF_SELECT_WITHOUT_BAR)); @@ -1060,7 +1065,7 @@ void real_units_report_dialog_update(void *unused) } /************************************************************************** - Popup (or raise) the units report (F2). It may or may not be modal. + Popup (or raise) the units report (F2). It may or may not be modal. **************************************************************************/ void units_report_dialog_popup(bool make_modal) { @@ -1613,7 +1618,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); @@ -1640,10 +1645,10 @@ static int popup_sell_impr_callback(struct widget *pWidget) area.w = MAX(area.w, pText->w + adj_size(20)); area.h += (pText->h + adj_size(10)); - /* cancel button */ - pBuf = create_themeicon_button_from_chars(current_theme->CANCEL_Icon, - pWindow->dst, _("No"), - adj_font(12), 0); + /* Cancel button */ + pBuf = create_themeicon_button_from_chars_fonto(current_theme->CANCEL_Icon, + pWindow->dst, _("No"), + FONTO_ATTENTION, 0); pBuf->action = cancel_sell_impr_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1653,8 +1658,10 @@ static int popup_sell_impr_callback(struct widget *pWidget) add_to_gui_list(ID_BUTTON, pBuf); if (count > 0) { - pBuf = create_themeicon_button_from_chars(current_theme->OK_Icon, pWindow->dst, - _("Sell"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->OK_Icon, + pWindow->dst, + _("Sell"), + FONTO_ATTENTION, 0); pBuf->action = ok_sell_impr_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -1825,7 +1832,7 @@ void economy_report_dialog_popup(bool make_modal) return; } - /* disable "Economy" button */ + /* Disable "Economy" button */ pBuf = get_tax_rates_widget(); set_wstate(pBuf, FC_WS_DISABLED); widget_redraw(pBuf); @@ -1836,7 +1843,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); @@ -1852,14 +1859,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; pTreasuryText = create_text_surf_from_utf8(pstr2); w3 = MAX(w3, pTreasuryText->w); /* "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); pBuf = create_iconlabel(pIcons->pBIG_Coin, pWindow->dst, pstr, @@ -1877,9 +1884,9 @@ void economy_report_dialog_popup(bool make_modal) w3 = MAX(w3, pTaxRateText->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); pBuf = create_iconlabel(NULL, pWindow->dst, pstr, WF_RESTORE_BACKGROUND); @@ -1897,7 +1904,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; pBuf = create_iconlabel(NULL, pWindow->dst, pstr, WF_RESTORE_BACKGROUND); @@ -1914,7 +1921,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; pBuf = create_iconlabel(NULL, pWindow->dst, pstr, WF_RESTORE_BACKGROUND); @@ -1932,7 +1939,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) { @@ -2047,7 +2054,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); pBuf = create_themeicon_button(current_theme->Small_OK_Icon, pWindow->dst, pstr, 0); pBuf->action = apply_taxrates_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -2057,7 +2064,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); pBuf = create_themeicon(current_theme->Small_CANCEL_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); pBuf->info_label = pstr; @@ -2568,7 +2575,7 @@ SDL_Surface *create_select_tech_icon(utf8_str *pstr, Tech_type_id tech_id, } /************************************************************************** - enable science dialog group ( without window ) + Enable science dialog group ( without window ) **************************************************************************/ static void enable_science_dialog(void) { @@ -2577,7 +2584,7 @@ static void enable_science_dialog(void) } /************************************************************************** - disable science dialog group ( without window ) + Disable science dialog group ( without window ) **************************************************************************/ static void disable_science_dialog(void) { @@ -2616,19 +2623,19 @@ void real_science_report_dialog_update(void *unused) cost = 0; } - /* update current research icons */ + /* Update current research icons */ FREESURFACE(pChangeResearchButton->theme); pChangeResearchButton->theme = get_tech_icon(presearch->researching); FREESURFACE(pChangeResearchGoalButton->theme); pChangeResearchGoalButton->theme = get_tech_icon(presearch->tech_goal); - /* redraw Window */ + /* Redraw Window */ widget_redraw(pWindow); /* ------------------------------------- */ - /* research progress text */ - pStr = create_utf8_from_char(science_dialog_text(), adj_font(12)); + /* Research progress text */ + pStr = create_utf8_from_char_fonto(science_dialog_text(), FONTO_ATTENTION); pStr->style |= SF_CENTER; pStr->fgcol = *get_theme_color(COLOR_THEME_SCIENCEDLG_TEXT); @@ -2933,7 +2940,8 @@ static void popup_change_research_dialog(void) pChangeTechDlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - 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); @@ -2946,11 +2954,11 @@ static void popup_change_research_dialog(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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += pBuf->size.w + adj_size(10); pBuf->action = exit_change_tech_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -3121,7 +3129,7 @@ static void popup_change_research_goal_dialog(void) pChangeTechDlg = fc_calloc(1, sizeof(struct ADVANCED_DLG)); - 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); @@ -3134,11 +3142,11 @@ static void popup_change_research_goal_dialog(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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); area.w += pBuf->size.w + adj_size(10); pBuf->action = exit_change_tech_dlg_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -3350,7 +3358,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); @@ -3359,7 +3367,7 @@ void science_report_dialog_popup(bool raise) pScienceDlg = fc_calloc(1, sizeof(struct SMALL_DLG)); /* 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 @@ -3417,12 +3425,12 @@ void science_report_dialog_popup(bool raise) add_to_gui_list(ID_SCIENCE_DLG_CHANGE_GOAL_BUTTON, pChangeResearchGoalButton); /* ------ */ - /* exit button */ + /* Exit button */ pExitButton = create_themeicon(current_theme->Small_CANCEL_Icon, pWindow->dst, WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND); - pExitButton->info_label = create_utf8_from_char(_("Close Dialog (Esc)"), - adj_font(12)); + pExitButton->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pExitButton->action = popdown_science_dialog_callback; set_wstate(pExitButton, FC_WS_NORMAL); pExitButton->key = SDLK_ESCAPE; diff --git a/client/gui-sdl2/spaceshipdlg.c b/client/gui-sdl2/spaceshipdlg.c index 3a66a430bd..d498a75da0 100644 --- a/client/gui-sdl2/spaceshipdlg.c +++ b/client/gui-sdl2/spaceshipdlg.c @@ -156,7 +156,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); @@ -171,12 +171,12 @@ void popup_spaceship_dialog(struct player *pPlayer) area = pWindow->area; /* ---------- */ - /* create exit button */ + /* Create 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 (Esc)"), - adj_font(12)); + pBuf->info_label = create_utf8_from_char_fonto(_("Close Dialog (Esc)"), + FONTO_ATTENTION); pBuf->data.player = pPlayer; pBuf->action = exit_space_dialog_callback; set_wstate(pBuf, FC_WS_NORMAL); @@ -185,15 +185,17 @@ void popup_spaceship_dialog(struct player *pPlayer) add_to_gui_list(ID_BUTTON, pBuf); - pBuf = create_themeicon_button_from_chars(current_theme->OK_Icon, pWindow->dst, - _("Launch"), adj_font(12), 0); + pBuf = create_themeicon_button_from_chars_fonto(current_theme->OK_Icon, + pWindow->dst, + _("Launch"), + FONTO_ATTENTION, 0); pBuf->action = launch_spaceship_callback; area.w = MAX(area.w, pBuf->size.w); area.h += pBuf->size.h + adj_size(20); add_to_gui_list(ID_BUTTON, pBuf); - 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}; pBuf = create_iconlabel(NULL, pWindow->dst, pstr, WF_RESTORE_BACKGROUND); area.w = MAX(area.w, pBuf->size.w); diff --git a/client/gui-sdl2/widget_button.h b/client/gui-sdl2/widget_button.h index 10647e9e56..6e274cdc95 100644 --- a/client/gui-sdl2/widget_button.h +++ b/client/gui-sdl2/widget_button.h @@ -19,6 +19,11 @@ create_utf8_from_char(pCharString, iPtsize), \ flags) +#define create_icon_button_from_chars_fonto(pIcon, pDest, pCharString, fonto, flags) \ + create_icon_button(pIcon, pDest, \ + create_utf8_from_char_fonto(pCharString, fonto), \ + flags) + #define create_themeicon_button_from_chars(pIcon_theme, pDest, pCharString, iPtsize, flags) \ create_themeicon_button(pIcon_theme, pDest, \ create_utf8_from_char(pCharString, \ 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 cbea7c3556..7b12918936 100644 --- a/client/gui-sdl2/wldlg.c +++ b/client/gui-sdl2/wldlg.c @@ -1123,7 +1123,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); pBuf = create_iconlabel(NULL, pWindow->dst, pstr, WF_RESTORE_BACKGROUND); @@ -1132,7 +1132,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}; @@ -1184,7 +1184,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); pBuf = create_iconlabel(pIcon, pWindow->dst, pstr, -- 2.39.2