Complete.Org: Mailing Lists: Archives: freeciv-dev: October 2004:
[Freeciv-Dev] (PR#10629) [PATCH] Move city description from window title
Home

[Freeciv-Dev] (PR#10629) [PATCH] Move city description from window title

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#10629) [PATCH] Move city description from window title to inside the dialog.
From: "Vasco Alexandre da Silva Costa" <vasc@xxxxxxxxxxxxxx>
Date: Tue, 19 Oct 2004 14:11:59 -0700
Reply-to: rt@xxxxxxxxxxx

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

Requested by Mike.

Index: client/gui-gtk-2.0/citydlg.c
===================================================================
RCS file: /home/freeciv/CVS/freeciv/client/gui-gtk-2.0/citydlg.c,v
retrieving revision 1.96
diff -u -r1.96 citydlg.c
--- client/gui-gtk-2.0/citydlg.c        19 Oct 2004 16:35:33 -0000      1.96
+++ client/gui-gtk-2.0/citydlg.c        19 Oct 2004 21:09:56 -0000
@@ -103,6 +103,7 @@
   struct city *pcity;
 
   GtkWidget *shell;
+  GtkWidget *name_label;
   GtkWidget *citizen_pixmap;
   GdkPixmap *map_canvas_store;
   GtkWidget *notebook;
@@ -1098,7 +1099,7 @@
                                             canvas_height, -1);
 
 
-  pdialog->shell = gtk_dialog_new_with_buttons(pcity->name,
+  pdialog->shell = gtk_dialog_new_with_buttons(_("City"),
        NULL,
        0,
        NULL);
@@ -1135,6 +1136,9 @@
 
   vbox = GTK_DIALOG(pdialog->shell)->vbox;
 
+  pdialog->name_label = gtk_label_new(NULL);
+  gtk_box_pack_start(GTK_BOX(vbox), pdialog->name_label, TRUE, TRUE, 2);
+
   /**** -Start of Notebook- ****/
 
   pdialog->notebook = gtk_notebook_new();
@@ -1237,9 +1241,9 @@
 static void city_dialog_update_title(struct city_dialog *pdialog)
 {
   char buf[512];
-  char *now;
+  const gchar *now;
 
-  my_snprintf(buf, sizeof(buf), _("%s - %s citizens"),
+  my_snprintf(buf, sizeof(buf), _("<b>%s</b> - %s citizens"),
              pdialog->pcity->name,
              population_to_text(city_population(pdialog->pcity)));
 
@@ -1251,9 +1255,9 @@
     mystrlcat(buf, _(" - happy"), sizeof(buf));
   }
 
-  now = GTK_WINDOW(pdialog->shell)->title;
+  now = gtk_label_get_text(GTK_LABEL(pdialog->name_label));
   if (strcmp(now, buf) != 0) {
-    gtk_window_set_title(GTK_WINDOW(pdialog->shell), buf);
+    gtk_label_set_markup(GTK_LABEL(pdialog->name_label), buf);
   }
 }
 

[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#10629) [PATCH] Move city description from window title to inside the dialog., Vasco Alexandre da Silva Costa <=