From 0324fcd0258f288a3f33be2cd19a85dbfe0b3c1b Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 6 Aug 2022 09:12:03 +0300 Subject: [PATCH 46/46] gtk4: Fix constructing of the citydlg production combo Do not try to set progress bar in to the combo, but set it to the parent grid next to the combo. See osdn #45311 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/citydlg.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/client/gui-gtk-4.0/citydlg.c b/client/gui-gtk-4.0/citydlg.c index 576f4d87b7..95614c8b80 100644 --- a/client/gui-gtk-4.0/citydlg.c +++ b/client/gui-gtk-4.0/citydlg.c @@ -999,6 +999,13 @@ static void create_and_append_overview_page(struct city_dialog *pdialog) G_TYPE_INT, G_TYPE_BOOLEAN); pdialog->overview.change_production_store = production_store; + bar = gtk_progress_bar_new(); + gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(bar), TRUE); + pdialog->overview.production_bar = bar; + gtk_grid_attach(GTK_GRID(hgrid), bar, grid_col++, 0, 1, 1); + + gtk_progress_bar_set_text(GTK_PROGRESS_BAR(bar), _("%d/%d %d turns")); + production_combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(production_store)); gtk_widget_set_hexpand(production_combo, TRUE); @@ -1020,13 +1027,6 @@ static void create_and_append_overview_page(struct city_dialog *pdialog) gtk_cell_layout_set_attributes(GTK_CELL_LAYOUT(production_combo), rend, "text", 1, "strikethrough", 3, NULL); - bar = gtk_progress_bar_new(); - gtk_progress_bar_set_show_text(GTK_PROGRESS_BAR(bar), TRUE); - pdialog->overview.production_bar = bar; - gtk_combo_box_set_child(GTK_COMBO_BOX(production_combo), bar); - - gtk_progress_bar_set_text(GTK_PROGRESS_BAR(bar), _("%d/%d %d turns")); - pdialog->overview.buy_command = icon_label_button_new("system-run", _("_Buy")); gtk_grid_attach(GTK_GRID(hgrid), GTK_WIDGET(pdialog->overview.buy_command), -- 2.35.1