mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Added GTK utility helpers for box/grid creation and attachment that map GTK3 layout settings while preserving GTK2 fallbacks.
Updated multiple GTK UI layout paths (setup, server list, notify, ban list, join dialog, and menu) to use the new helpers for GTK3-safe box/grid creation and attachment behavior. Added GTK3-safe attach option definitions and updated helper signatures to avoid GTK2-only types/macros in public headers. Updated gtkutil grid-attachment helpers to use the new attach option type in alignment/expansion logic. Switched banlist grid attachments to the new helper option flags for GTK3 builds.
This commit is contained in:
@@ -341,19 +341,11 @@ cv_tabs_init (chanview *cv)
|
||||
|
||||
if (cv->vertical)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
outer = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
#elif !HAVE_GTK3
|
||||
outer = gtk_vbox_new (0, 0);
|
||||
#endif
|
||||
outer = gtkutil_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
outer = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
#elif !HAVE_GTK3
|
||||
outer = gtk_hbox_new (0, 0);
|
||||
#endif
|
||||
outer = gtkutil_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
|
||||
}
|
||||
((tabview *)cv)->outer = outer;
|
||||
g_signal_connect (G_OBJECT (outer), "size_allocate",
|
||||
@@ -372,19 +364,11 @@ cv_tabs_init (chanview *cv)
|
||||
|
||||
if (cv->vertical)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
|
||||
#elif !HAVE_GTK3
|
||||
box = gtk_vbox_new (FALSE, 0);
|
||||
#endif
|
||||
box = gtkutil_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
#elif !HAVE_GTK3
|
||||
box = gtk_hbox_new (FALSE, 0);
|
||||
#endif
|
||||
box = gtkutil_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
|
||||
}
|
||||
((tabview *)cv)->inner = box;
|
||||
gtk_container_add (GTK_CONTAINER (viewport), box);
|
||||
@@ -393,11 +377,7 @@ 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
|
||||
hbox = gtkutil_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (outer), hbox, 0, 0, 0);
|
||||
gtk_widget_show (hbox);
|
||||
}
|
||||
@@ -565,11 +545,7 @@ 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
|
||||
box = gtkutil_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 0);
|
||||
#if HAVE_GTK3
|
||||
sep = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
|
||||
#elif !HAVE_GTK3
|
||||
@@ -578,11 +554,7 @@ tab_add_real (chanview *cv, GtkWidget *tab, chan *ch)
|
||||
} else
|
||||
{
|
||||
/* horiz */
|
||||
#if HAVE_GTK3
|
||||
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
|
||||
#elif !HAVE_GTK3
|
||||
box = gtk_hbox_new (FALSE, 0);
|
||||
#endif
|
||||
box = gtkutil_box_new (GTK_ORIENTATION_HORIZONTAL, FALSE, 0);
|
||||
#if HAVE_GTK3
|
||||
sep = gtk_separator_new (GTK_ORIENTATION_VERTICAL);
|
||||
#elif !HAVE_GTK3
|
||||
|
||||
Reference in New Issue
Block a user