diff --git a/client/gui-gtk-3.0/cma_fe.c b/client/gui-gtk-3.0/cma_fe.c index 56425b7377..ea3205cd78 100644 --- a/client/gui-gtk-3.0/cma_fe.c +++ b/client/gui-gtk-3.0/cma_fe.c @@ -33,6 +33,7 @@ #include "client_main.h" #include "cma_fec.h" #include "messagewin_g.h" +#include "options.h" /* client/gtk-3.0 */ #include "cityrep.h" @@ -207,7 +208,7 @@ static void cell_data_func(GtkTreeViewColumn *col, GtkCellRenderer *cell, } /************************************************************************** - instantiates a new struct for each city_dialog window that is open. + Instantiates a new struct for each city_dialog window that is open. **************************************************************************/ struct cma_dialog *create_cma_dialog(struct city *pcity, bool tiny) { @@ -351,7 +352,9 @@ struct cma_dialog *create_cma_dialog(struct city *pcity, bool tiny) pdialog->minimal_surplus[i] = hscale = gtk_scale_new(GTK_ORIENTATION_HORIZONTAL, NULL); - gtk_range_set_range(GTK_RANGE(hscale), -20, 20); + gtk_range_set_range(GTK_RANGE(hscale), + gui_options.gui_gtk3_governor_range_min, + gui_options.gui_gtk3_governor_range_max); gtk_range_set_increments(GTK_RANGE(hscale), 1, 1); pango_layout_get_pixel_size(gtk_scale_get_layout(GTK_SCALE(hscale)), &layout_width, NULL); diff --git a/client/options.c b/client/options.c index 81ee0c738d..69c158eaa7 100644 --- a/client/options.c +++ b/client/options.c @@ -231,6 +231,8 @@ struct client_options gui_options = { .gui_gtk3_citydlg_xsize = GUI_GTK3_CITYDLG_DEFAULT_XSIZE, .gui_gtk3_citydlg_ysize = GUI_GTK3_CITYDLG_DEFAULT_YSIZE, .gui_gtk3_popup_tech_help = GUI_POPUP_TECH_HELP_RULESET, + .gui_gtk3_governor_range_min = -20, + .gui_gtk3_governor_range_max = 20, .gui_gtk3_font_city_label = "Monospace 8", .gui_gtk3_font_notify_label = "Monospace Bold 9", .gui_gtk3_font_spaceship_label = "Monospace 8", @@ -2590,6 +2592,20 @@ static struct client_option client_options[] = { "current ruleset is used."), COC_INTERFACE, GUI_GTK3, GUI_POPUP_TECH_HELP_RULESET, gui_popup_tech_help_name, NULL), + GEN_INT_OPTION(gui_gtk3_governor_range_min, + N_("Minimum surplus for a governor"), + N_("The lower limit of the range for requesting surpluses " + "from the governor."), + COC_INTERFACE, GUI_GTK3, GUI_GTK3_GOV_RANGE_MIN_DEFAULT, + GUI_GTK3_GOV_RANGE_MIN_MIN, GUI_GTK3_GOV_RANGE_MIN_MAX, + NULL), + GEN_INT_OPTION(gui_gtk3_governor_range_max, + N_("Maximum surplus for a governor"), + N_("The higher limit of the range for requesting surpluses " + "from the governor."), + COC_INTERFACE, GUI_GTK3, GUI_GTK3_GOV_RANGE_MAX_DEFAULT, + GUI_GTK3_GOV_RANGE_MAX_MIN, GUI_GTK3_GOV_RANGE_MAX_MAX, + NULL), GEN_FONT_OPTION(gui_gtk3_font_city_label, "city_label", N_("City Label"), N_("This font is used to display the city labels on city " diff --git a/client/options.h b/client/options.h index 47247da784..86f733cc5c 100644 --- a/client/options.h +++ b/client/options.h @@ -244,7 +244,9 @@ struct client_options bool gui_gtk3_chatline_autocompletion; int gui_gtk3_citydlg_xsize; int gui_gtk3_citydlg_ysize; - int gui_gtk3_popup_tech_help; + int gui_gtk3_popup_tech_help; + int gui_gtk3_governor_range_min; + int gui_gtk3_governor_range_max; char gui_gtk3_font_city_label[512]; char gui_gtk3_font_notify_label[512]; char gui_gtk3_font_spaceship_label[512]; @@ -474,6 +476,14 @@ extern int messages_where[]; /* OR-ed MW_ values [E_COUNT] */ #define GUI_GTK3_CITYDLG_MIN_YSIZE 128 #define GUI_GTK3_CITYDLG_MAX_YSIZE 4096 +#define GUI_GTK3_GOV_RANGE_MIN_DEFAULT -20 +#define GUI_GTK3_GOV_RANGE_MIN_MIN -100 +#define GUI_GTK3_GOV_RANGE_MIN_MAX 0 + +#define GUI_GTK3_GOV_RANGE_MAX_DEFAULT 20 +#define GUI_GTK3_GOV_RANGE_MAX_MIN 0 +#define GUI_GTK3_GOV_RANGE_MAX_MAX 100 + #define GUI_DEFAULT_MAPIMG_FILENAME "freeciv" #ifdef __cplusplus