Added #if HAVE_GTK3 / #elif !HAVE_GTK3 branches around gtk_hbox_new / gtk_vbox_new call sites in the GTK front-end, using gtk_box_new(GTK_ORIENTATION_*, spacing) for GTK3 while keeping the GTK2 constructors explicitly gated under !HAVE_GTK3.

Applied gtk_box_set_homogeneous() in GTK3 branches where the GTK2 code requested homogeneous layout (e.g., dialog hboxes).
Updated remaining helpers and setup/preferences UI box constructors (including the shared mg_box_new helper) to follow the same GTK3/GTK2 branching approach consistently across src/fe-gtk/
This commit is contained in:
2026-01-23 21:28:32 -07:00
parent 5b1a58195e
commit ab3bdf219f
11 changed files with 154 additions and 3 deletions

View File

@@ -289,9 +289,21 @@ cv_tabs_init (chanview *cv)
GtkWidget *button;
if (cv->vertical)
{
#if HAVE_GTK3
outer = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
#elif !HAVE_GTK3
outer = gtk_vbox_new (0, 0);
#endif
}
else
{
#if HAVE_GTK3
outer = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
#elif !HAVE_GTK3
outer = gtk_hbox_new (0, 0);
#endif
}
((tabview *)cv)->outer = outer;
g_signal_connect (G_OBJECT (outer), "size_allocate",
G_CALLBACK (cv_tabs_sizealloc), cv);
@@ -308,9 +320,21 @@ cv_tabs_init (chanview *cv)
gtk_widget_show (viewport);
if (cv->vertical)
{
#if HAVE_GTK3
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
#elif !HAVE_GTK3
box = gtk_vbox_new (FALSE, 0);
#endif
}
else
{
#if HAVE_GTK3
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
#elif !HAVE_GTK3
box = gtk_hbox_new (FALSE, 0);
#endif
}
((tabview *)cv)->inner = box;
gtk_container_add (GTK_CONTAINER (viewport), box);
gtk_widget_show (box);
@@ -318,7 +342,11 @@ cv_tabs_init (chanview *cv)
/* if vertical, the buttons can be side by side */
if (cv->vertical)
{
#if HAVE_GTK3
hbox = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
#elif !HAVE_GTK3
hbox = gtk_hbox_new (FALSE, 0);
#endif
gtk_box_pack_start (GTK_BOX (outer), hbox, 0, 0, 0);
gtk_widget_show (hbox);
}
@@ -486,12 +514,20 @@ tab_add_real (chanview *cv, GtkWidget *tab, chan *ch)
if (cv->vertical)
{
/* vertical */
#if HAVE_GTK3
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
#elif !HAVE_GTK3
box = gtk_vbox_new (FALSE, 0);
#endif
sep = gtk_hseparator_new ();
} else
{
/* horiz */
#if HAVE_GTK3
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
#elif !HAVE_GTK3
box = gtk_hbox_new (FALSE, 0);
#endif
sep = gtk_vseparator_new ();
}