123 if (ev->button == 1) {
124 GtkWidget *p, *label, *frame;
127 switch (GPOINTER_TO_UINT(data)) {
150 p = gtk_window_new(GTK_WINDOW_POPUP);
151 gtk_widget_set_name(p,
"Freeciv");
152 gtk_container_set_border_width(GTK_CONTAINER(p), 2);
153 gtk_window_set_transient_for(GTK_WINDOW(p), GTK_WINDOW(pdialog->
win));
154 gtk_window_set_position(GTK_WINDOW(p), GTK_WIN_POS_MOUSE);
156 frame = gtk_frame_new(NULL);
157 gtk_container_add(GTK_CONTAINER(p), frame);
159 label = gtk_label_new(buf);
162 gtk_widget_set_name(label,
"city_happiness_label");
163 gtk_widget_set_margin_left(label, 4);
164 gtk_widget_set_margin_right(label, 4);
165 gtk_widget_set_margin_top(label, 4);
166 gtk_widget_set_margin_bottom(label, 4);
167 gtk_container_add(GTK_CONTAINER(frame), label);
168 gtk_widget_show_all(p);
170 gdk_device_grab(ev->device, gtk_widget_get_window(p),
171 GDK_OWNERSHIP_NONE,
TRUE, GDK_BUTTON_RELEASE_MASK, NULL,
175 g_signal_connect_after(p,
"button_release_event",
204 GtkWidget *ebox, *label, *table;
215 static bool happiness_label_str_done;
220 pdialog->
shell = gtk_grid_new();
221 gtk_orientable_set_orientation(GTK_ORIENTABLE(pdialog->
shell),
222 GTK_ORIENTATION_VERTICAL);
227 table = gtk_grid_new();
228 g_object_set(table,
"margin", 4, NULL);
229 gtk_grid_set_row_spacing(GTK_GRID(table), 10);
232 &happiness_label_str_done);
242 label = gtk_label_new(happiness_label_str[i]);
244 gtk_widget_set_name(label,
"city_label");
245 gtk_widget_set_halign(label, GTK_ALIGN_START);
246 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
248 gtk_grid_attach(GTK_GRID(table), label, 0, i, 1, 1);
251 ebox = gtk_event_box_new();
252 gtk_widget_set_margin_left(ebox, 5);
253 gtk_event_box_set_visible_window(GTK_EVENT_BOX(ebox),
FALSE);
254 g_object_set_data(G_OBJECT(ebox),
"pdialog", pdialog);
255 g_signal_connect(ebox,
"button_press_event",
259 pdialog->
feeling_surfaces[i] = cairo_image_surface_create(CAIRO_FORMAT_ARGB32,
262 gtk_container_add(GTK_CONTAINER(ebox),
img);
263 gtk_widget_set_halign(
img, GTK_ALIGN_START);
264 gtk_widget_set_valign(
img, GTK_ALIGN_START);
266 gtk_grid_attach(GTK_GRID(table), ebox, 1, i, 1, 1);
272 _(
"Additional information is available%svia left "
273 "click on the citizens."), low_dlg ?
"\n" :
" ");
274 label = gtk_label_new(buf);
275 gtk_widget_set_name(label,
"city_label");
276 gtk_widget_set_halign(label, GTK_ALIGN_START);
277 gtk_widget_set_valign(label, GTK_ALIGN_CENTER);
280 gtk_widget_show_all(pdialog->
shell);
const char * text_happiness_cities(const struct city *pcity)
const char * text_happiness_nationality(const struct city *pcity)
const char * text_happiness_wonders(const struct city *pcity)
const char * text_happiness_units(const struct city *pcity)
const char * text_happiness_luxuries(const struct city *pcity)
const char * text_happiness_buildings(const struct city *pcity)