Project

General

Profile

Bug #1289 » 1289.patch

Dean Brown, 04/11/2025 11:59 PM

View differences:

client/gui-gtk-3.22/citydlg.c
/******************** Callbacks for: Close, Prev, Next. ******************/
/**********************************************************************//**
User has clicked rename city-button
User has closed city dialog
**************************************************************************/
static void close_callback(GtkWidget *w, gpointer data)
{
......
}
/**********************************************************************//**
User has closed rename city dialog
User has closed city dialog
**************************************************************************/
static void city_destroy_callback(GtkWidget *w, gpointer data)
{
struct city_dialog *pdialog;
int width, height;
GtkWidget* cont_area;
pdialog = (struct city_dialog *) data;
cont_area = gtk_dialog_get_content_area (GTK_DIALOG(pdialog->shell));
width = gtk_widget_get_allocated_width(GTK_WIDGET(cont_area));
height = gtk_widget_get_allocated_height(GTK_WIDGET(cont_area));
gtk_widget_hide(pdialog->shell);
if (game.info.citizen_nationality) {
......
/* Save size of the city dialog. */
GUI_GTK_OPTION(citydlg_xsize)
= CLIP(GUI_GTK3_22_CITYDLG_MIN_XSIZE,
gtk_widget_get_allocated_width(pdialog->shell),
width,
GUI_GTK3_22_CITYDLG_MAX_XSIZE);
GUI_GTK_OPTION(citydlg_ysize)
= CLIP(GUI_GTK3_22_CITYDLG_MIN_XSIZE,
gtk_widget_get_allocated_height(pdialog->shell),
GUI_GTK3_22_CITYDLG_MAX_XSIZE);
= CLIP(GUI_GTK3_22_CITYDLG_MIN_YSIZE,
height,
GUI_GTK3_22_CITYDLG_MAX_YSIZE);
last_page
= gtk_notebook_get_current_page(GTK_NOTEBOOK(pdialog->notebook));
client/gui-gtk-4.0/citydlg.c
/******************** Callbacks for: Close, Prev, Next. *******************/
/***********************************************************************//**
User has clicked rename city-button
User has closed city dialog
***************************************************************************/
static void close_callback(GtkWidget *w, gpointer data)
{
......
}
/***********************************************************************//**
User has closed rename city dialog
User has closed city dialog
***************************************************************************/
static void city_destroy_callback(GtkWidget *w, gpointer data)
{
struct city_dialog *pdialog;
int width, height;
pdialog = (struct city_dialog *) data;
gtk_window_get_default_size (GTK_WINDOW(w), &width, &height);
pdialog = (struct city_dialog *) data;
gtk_widget_hide(pdialog->shell);
if (game.info.citizen_nationality) {
......
/* Save size of the city dialog. */
GUI_GTK_OPTION(citydlg_xsize)
= CLIP(GUI_GTK4_CITYDLG_MIN_XSIZE,
gtk_widget_get_allocated_width(pdialog->shell),
width,
GUI_GTK4_CITYDLG_MAX_XSIZE);
GUI_GTK_OPTION(citydlg_ysize)
= CLIP(GUI_GTK4_CITYDLG_MIN_XSIZE,
gtk_widget_get_allocated_height(pdialog->shell),
GUI_GTK4_CITYDLG_MAX_XSIZE);
= CLIP(GUI_GTK4_CITYDLG_MIN_YSIZE,
height,
GUI_GTK4_CITYDLG_MAX_YSIZE);
last_page
= gtk_notebook_get_current_page(GTK_NOTEBOOK(pdialog->notebook));
(1-1/2)