From f488e285ccee8c1df6f61f3d81a761a2d2ad9dcb Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sat, 27 Nov 2021 16:36:27 +0200 Subject: [PATCH 42/42] gtk3x: Replace gtk_paned_pack[12]() calls gtk-3.98.4 drops gtk_paned_pack1() and gtk_paned_pack2(). Use gtk_paned_set_start_child() and gtk_paned_set_end_child() in gtk3x-client code instead. See osdn #43288 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/editprop.c | 4 ++-- client/gui-gtk-4.0/gtkcompat.h | 2 ++ client/gui-gtk-4.0/gui_main.c | 8 ++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/client/gui-gtk-4.0/editprop.c b/client/gui-gtk-4.0/editprop.c index fa693d12d2..b68e520522 100644 --- a/client/gui-gtk-4.0/editprop.c +++ b/client/gui-gtk-4.0/editprop.c @@ -4787,7 +4787,7 @@ property_page_new(enum editor_object_type objtype, gtk_widget_set_margin_end(vgrid, 4); gtk_widget_set_margin_top(vgrid, 4); gtk_widget_set_margin_bottom(vgrid, 4); - gtk_paned_pack1(GTK_PANED(paned), vgrid, TRUE, TRUE); + gtk_paned_set_start_child(GTK_PANED(paned), vgrid); scrollwin = gtk_scrolled_window_new(); gtk_scrolled_window_set_has_frame(GTK_SCROLLED_WINDOW(scrollwin), @@ -4889,7 +4889,7 @@ property_page_new(enum editor_object_type objtype, hgrid = gtk_grid_new(); grid_col = 0; gtk_grid_set_column_spacing(GTK_GRID(hgrid), 4); - gtk_paned_pack2(GTK_PANED(paned), hgrid, TRUE, TRUE); + gtk_paned_set_end_child(GTK_PANED(paned), hgrid); vgrid = gtk_grid_new(); gtk_orientable_set_orientation(GTK_ORIENTABLE(vgrid), diff --git a/client/gui-gtk-4.0/gtkcompat.h b/client/gui-gtk-4.0/gtkcompat.h index 0175749c60..6982e2d1b9 100644 --- a/client/gui-gtk-4.0/gtkcompat.h +++ b/client/gui-gtk-4.0/gtkcompat.h @@ -44,6 +44,8 @@ void gtk_button_set_has_frame(GtkButton *btn, bool shadow); gtk_container_add(GTK_CONTAINER(_sw_), _child_) #define gtk_combo_box_set_child(_cb_, _child_) \ gtk_container_add(GTK_CONTAINER(_cb_), _child_) +#define gtk_paned_set_start_child(_paned_, _child_) \ + gtk_paned_pack1(_paned_, _child_, TRUE, TRUE) #define gtk_paned_set_end_child(_paned_, _child_) \ gtk_paned_pack2(_paned_, _child_, FALSE, TRUE) #define gtk_button_set_child(_but_, _child_) \ diff --git a/client/gui-gtk-4.0/gui_main.c b/client/gui-gtk-4.0/gui_main.c index 9cf55c21a3..84fe479a57 100644 --- a/client/gui-gtk-4.0/gui_main.c +++ b/client/gui-gtk-4.0/gui_main.c @@ -1159,7 +1159,7 @@ static void setup_widgets(void) * + civinfo + unitinfo + main view, message window. */ paned = gtk_paned_new(GTK_ORIENTATION_VERTICAL); gtk_scrolled_window_set_child(GTK_SCROLLED_WINDOW(page), paned); - gtk_paned_pack1(GTK_PANED(paned), top_vbox, TRUE, FALSE); + gtk_paned_set_start_child(GTK_PANED(paned), top_vbox); gtk_grid_attach(GTK_GRID(top_vbox), hgrid, 0, top_row++, 1, 1); /* Overview size designed for big displays (desktops). */ @@ -1406,7 +1406,7 @@ static void setup_widgets(void) if (GUI_GTK_OPTION(small_display_layout)) { - gtk_paned_pack1(GTK_PANED(paned), top_notebook, TRUE, FALSE); + gtk_paned_set_start_child(GTK_PANED(paned), top_notebook); } else if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_MERGED) { right_vbox = gtk_grid_new(); right_row = 0; @@ -1520,7 +1520,7 @@ static void setup_widgets(void) bottom_notebook = gtk_notebook_new(); gtk_notebook_set_tab_pos(GTK_NOTEBOOK(bottom_notebook), GTK_POS_TOP); gtk_notebook_set_scrollable(GTK_NOTEBOOK(bottom_notebook), TRUE); - gtk_paned_pack1(GTK_PANED(hpaned), bottom_notebook, TRUE, TRUE); + gtk_paned_set_start_child(GTK_PANED(hpaned), bottom_notebook); right_notebook = gtk_notebook_new(); g_object_ref(right_notebook); @@ -1529,7 +1529,7 @@ static void setup_widgets(void) g_signal_connect(right_notebook, "button-release-event", G_CALLBACK(right_notebook_button_release), NULL); if (GUI_GTK_OPTION(message_chat_location) == GUI_GTK_MSGCHAT_SPLIT) { - gtk_paned_pack2(GTK_PANED(hpaned), right_notebook, TRUE, TRUE); + gtk_paned_set_end_child(GTK_PANED(hpaned), right_notebook); } } -- 2.33.0