<URL: http://bugs.freeciv.org/Ticket/Display.html?id=39422 >

More city styles (PR#15716) and larger (amplio) city style graphics
means that some alternate rulesets for freeciv have so many styles
that the window gets too large, even on my 1024x768 monitor (small
though).

Here is a patch to make the city style selector scroll.

* Make the Table that contains all of the Leader name, gender and city
style to expand to fill the space available.
* Make the city style list scroll vertically when needed
* Make other items in said Table stay small (all the 0, 0, 0, 0);
* Increase default nation selector window size (might be wanted to
increase even more. We need more than 580 px heigth or so to fit the
default city sizes. I don't know if we have a lower resolution
"recommendation")

the same patch is needed for both trunk and 2.1 branch

Index: client/gui-gtk-2.0/dialogs.c
===================================================================
--- client/gui-gtk-2.0/dialogs.c	(revision 13022)
+++ client/gui-gtk-2.0/dialogs.c	(arbetskopia)
@@ -781,7 +781,7 @@
   setup_dialog(shell, toplevel);
 
   gtk_window_set_position(GTK_WINDOW(shell), GTK_WIN_POS_CENTER_ON_PARENT);
-  gtk_window_set_default_size(GTK_WINDOW(shell), -1, 310);
+  gtk_window_set_default_size(GTK_WINDOW(shell), -1, 400);
 
   frame = gtk_frame_new(_("Select a nation"));
   gtk_container_add(GTK_CONTAINER(GTK_DIALOG(shell)->vbox), frame);
@@ -811,7 +811,7 @@
   gtk_table_set_row_spacings(GTK_TABLE(table), 2);
   gtk_table_set_col_spacing(GTK_TABLE(table), 0, 12);
   gtk_table_set_col_spacing(GTK_TABLE(table), 1, 12);
-  gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
+  gtk_box_pack_start(GTK_BOX(vbox), table, TRUE, TRUE, 0);
 
   /* Leader. */ 
   combo = gtk_combo_new();
@@ -825,17 +825,17 @@
       "xalign", 0.0,
       "yalign", 0.5,
       NULL);
-  gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 0, 2);
-  gtk_table_attach_defaults(GTK_TABLE(table), combo, 1, 3, 0, 1);
+  gtk_table_attach(GTK_TABLE(table), label, 0, 1, 0, 2, 0, 0, 0, 0);
+  gtk_table_attach(GTK_TABLE(table), combo, 1, 3, 0, 1, 0, 0, 0, 0);
 
   cmd = gtk_radio_button_new_with_mnemonic(NULL, _("_Female"));
   races_sex[0] = cmd;
-  gtk_table_attach_defaults(GTK_TABLE(table), cmd, 1, 2, 1, 2);
+  gtk_table_attach(GTK_TABLE(table), cmd, 1, 2, 1, 2, 0, 0, 0, 0);
 
   cmd = gtk_radio_button_new_with_mnemonic_from_widget(GTK_RADIO_BUTTON(cmd),
       _("_Male"));
   races_sex[1] = cmd;
-  gtk_table_attach_defaults(GTK_TABLE(table), cmd, 2, 3, 1, 2);
+  gtk_table_attach(GTK_TABLE(table), cmd, 2, 3, 1, 2, 0, 0, 0, 0);
 
   /* City style. */
   store = gtk_list_store_new(3, G_TYPE_INT,
@@ -852,7 +852,7 @@
   gtk_scrolled_window_set_shadow_type(GTK_SCROLLED_WINDOW(sw),
       GTK_SHADOW_ETCHED_IN);
   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
-      GTK_POLICY_NEVER, GTK_POLICY_NEVER);
+      GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
   gtk_container_add(GTK_CONTAINER(sw), list);
   gtk_table_attach(GTK_TABLE(table), sw, 1, 3, 2, 4,
       GTK_EXPAND|GTK_FILL, GTK_EXPAND|GTK_FILL, 0, 0);
@@ -864,7 +864,7 @@
       "xalign", 0.0,
       "yalign", 0.5,
       NULL);
-  gtk_table_attach_defaults(GTK_TABLE(table), label, 0, 1, 2, 3);
+  gtk_table_attach(GTK_TABLE(table), label, 0, 1, 2, 3, 0, 0, 0, 0);
 
   render = gtk_cell_renderer_pixbuf_new();
   column = gtk_tree_view_column_new_with_attributes(NULL, render,
_______________________________________________
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev

Reply via email to