Complete.Org: Mailing Lists: Archives: freeciv-dev: November 2004:
[Freeciv-Dev] (PR#10832) Make economy and units report lists only as lar
Home

[Freeciv-Dev] (PR#10832) Make economy and units report lists only as lar

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10832) Make economy and units report lists only as large as strictly necessary.
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Mon, 1 Nov 2004 13:57:54 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=10832 >

What the subject says.

Index: client/gui-gtk-2.0/repodlgs.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/repodlgs.c,v
retrieving revision 1.62
diff -u -r1.62 repodlgs.c
--- client/gui-gtk-2.0/repodlgs.c       1 Nov 2004 19:34:36 -0000       1.62
+++ client/gui-gtk-2.0/repodlgs.c       1 Nov 2004 21:56:07 -0000
@@ -638,13 +638,17 @@
     G_TYPE_INT,
     G_TYPE_INT
   };
-  GtkWidget *view, *sw;
+  GtkWidget *view, *sw, *align;
 
   intl_slist(ARRAY_SIZE(titles), titles, &titles_done);
   
   gui_dialog_new(&economy_dialog_shell, GTK_NOTEBOOK(top_notebook));
   gui_dialog_set_title(economy_dialog_shell, _("Economy"));
 
+  align = gtk_alignment_new(0.5, 0.0, 0.0, 1.0);
+  gtk_box_pack_start(GTK_BOX(economy_dialog_shell->vbox), align,
+      TRUE, TRUE, 0);
+
   economy_store = gtk_list_store_newv(ARRAY_SIZE(model_types), model_types);
 
   sw = gtk_scrolled_window_new(NULL,NULL);
@@ -652,10 +656,11 @@
                                      GTK_SHADOW_ETCHED_IN);
   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
                                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-  gtk_box_pack_start(GTK_BOX(economy_dialog_shell->vbox), sw, TRUE, TRUE, 0);
+  gtk_container_add(GTK_CONTAINER(align), sw);
 
   view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(economy_store));
   g_object_unref(economy_store);
+  gtk_tree_view_columns_autosize(GTK_TREE_VIEW(view));
   economy_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
   g_signal_connect(economy_selection, "changed",
                   G_CALLBACK(economy_selection_callback), NULL);
@@ -934,13 +939,17 @@
     G_TYPE_INT,
     G_TYPE_BOOLEAN
   };
-  GtkWidget *view, *sw;
+  GtkWidget *view, *sw, *align;
 
   intl_slist(ARRAY_SIZE(titles), titles, &titles_done);
 
   gui_dialog_new(&activeunits_dialog_shell, GTK_NOTEBOOK(top_notebook));
   gui_dialog_set_title(activeunits_dialog_shell, _("Units"));
 
+  align = gtk_alignment_new(0.5, 0.0, 0.0, 1.0);
+  gtk_box_pack_start(GTK_BOX(activeunits_dialog_shell->vbox), align,
+      TRUE, TRUE, 0);
+
   activeunits_store = gtk_list_store_newv(ARRAY_SIZE(model_types), 
model_types);
 
   sw = gtk_scrolled_window_new(NULL,NULL);
@@ -948,11 +957,11 @@
                                      GTK_SHADOW_ETCHED_IN);
   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw),
                                 GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC);
-  gtk_box_pack_start(GTK_BOX(activeunits_dialog_shell->vbox),
-       sw, TRUE, TRUE, 0);
+  gtk_container_add(GTK_CONTAINER(align), sw);
 
   view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(activeunits_store));
   g_object_unref(activeunits_store);
+  gtk_tree_view_columns_autosize(GTK_TREE_VIEW(view));
   activeunits_selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
   g_signal_connect(activeunits_selection, "changed",
        G_CALLBACK(activeunits_selection_callback), NULL);

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10832) Make economy and units report lists only as large as strictly necessary., Vasco Alexandre da Silva Costa <=