mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-10 07:50:19 +00:00
Added GTK3 expand/alignment setup before attaching widgets in banlist, chanlist, DCC, and main window layouts to mirror legacy table options.
Introduced a servlist table-attach helper and applied it across servlist UI attachments to keep GTK_FILL/GTK_EXPAND confined to GTK2-only paths while setting GTK3 alignment/margins explicitly.
This commit is contained in:
@@ -857,9 +857,11 @@ banlist_opengui (struct session *sess)
|
||||
g_signal_connect (G_OBJECT (banl->checkboxes[i]), "toggled",
|
||||
G_CALLBACK (banlist_toggle), banl);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), banl->checkboxes[i], i + 1, 0, 1, 1);
|
||||
gtk_widget_set_hexpand (banl->checkboxes[i], FALSE);
|
||||
gtk_widget_set_vexpand (banl->checkboxes[i], FALSE);
|
||||
gtk_widget_set_halign (banl->checkboxes[i], GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (banl->checkboxes[i], GTK_ALIGN_CENTER);
|
||||
gtk_grid_attach (GTK_GRID (table), banl->checkboxes[i], i + 1, 0, 1, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), banl->checkboxes[i], i+1, i+2, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
@@ -94,6 +94,22 @@ chanlist_set_label_alignment (GtkWidget *widget)
|
||||
#endif
|
||||
}
|
||||
|
||||
#if HAVE_GTK3
|
||||
static void
|
||||
chanlist_grid_attach (GtkWidget *grid, GtkWidget *child,
|
||||
gint column, gint row,
|
||||
gint width, gint height,
|
||||
gboolean hexpand, gboolean vexpand,
|
||||
GtkAlign halign, GtkAlign valign)
|
||||
{
|
||||
gtk_widget_set_hexpand (child, hexpand);
|
||||
gtk_widget_set_vexpand (child, vexpand);
|
||||
gtk_widget_set_halign (child, halign);
|
||||
gtk_widget_set_valign (child, valign);
|
||||
gtk_grid_attach (GTK_GRID (grid), child, column, row, width, height);
|
||||
}
|
||||
#endif
|
||||
|
||||
static GtkWidget *
|
||||
chanlist_box_new (void)
|
||||
{
|
||||
@@ -925,7 +941,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
#endif
|
||||
serv->gui->chanlist_search = wid;
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 3, 3, 1, 1);
|
||||
chanlist_grid_attach (table, wid, 3, 3, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 3, 4, 3, 4,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
@@ -941,7 +958,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
#endif
|
||||
serv->gui->chanlist_refresh = wid;
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 3, 2, 1, 1);
|
||||
chanlist_grid_attach (table, wid, 3, 2, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 3, 4, 2, 3,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
@@ -957,7 +975,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
#endif
|
||||
serv->gui->chanlist_savelist = wid;
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 3, 1, 1, 1);
|
||||
chanlist_grid_attach (table, wid, 3, 1, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 3, 4, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
@@ -973,7 +992,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
#endif
|
||||
serv->gui->chanlist_join = wid;
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 3, 0, 1, 1);
|
||||
chanlist_grid_attach (table, wid, 3, 0, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 3, 4, 0, 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
@@ -984,7 +1004,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
wid = gtk_label_new (_("Show only:"));
|
||||
chanlist_set_label_alignment (wid);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 0, 3, 1, 1);
|
||||
chanlist_grid_attach (table, wid, 0, 3, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_START, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 0, 1, 3, 4,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
@@ -994,7 +1015,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
hbox = chanlist_box_new ();
|
||||
gtk_box_set_spacing (GTK_BOX (hbox), 9);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), hbox, 1, 3, 1, 1);
|
||||
chanlist_grid_attach (table, hbox, 1, 3, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 3, 4,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
@@ -1035,7 +1057,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
wid = gtk_label_new (_("Look in:"));
|
||||
chanlist_set_label_alignment (wid);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 0, 2, 1, 1);
|
||||
chanlist_grid_attach (table, wid, 0, 2, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_START, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 0, 1, 2, 3,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
@@ -1045,7 +1068,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
hbox = chanlist_box_new ();
|
||||
gtk_box_set_spacing (GTK_BOX (hbox), 12);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), hbox, 1, 2, 1, 1);
|
||||
chanlist_grid_attach (table, hbox, 1, 2, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), hbox, 1, 2, 2, 3,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
@@ -1075,7 +1099,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
wid = gtk_label_new (_("Search type:"));
|
||||
chanlist_set_label_alignment (wid);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 0, 1, 1, 1);
|
||||
chanlist_grid_attach (table, wid, 0, 1, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_START, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 0, 1, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
@@ -1088,7 +1113,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
gtk_combo_box_text_append_text (GTK_COMBO_BOX_TEXT (wid), _("Regular Expression"));
|
||||
gtk_combo_box_set_active (GTK_COMBO_BOX (wid), serv->gui->chanlist_search_type);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 1, 1, 1, 1);
|
||||
chanlist_grid_attach (table, wid, 1, 1, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 1, 2, 1, 2,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
@@ -1102,7 +1128,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
wid = gtk_label_new (_("Find:"));
|
||||
chanlist_set_label_alignment (wid);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 0, 0, 1, 1);
|
||||
chanlist_grid_attach (table, wid, 0, 0, 1, 1, FALSE, FALSE,
|
||||
GTK_ALIGN_START, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 0, 1, 0, 1,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
@@ -1117,8 +1144,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
G_CALLBACK (chanlist_search_pressed),
|
||||
(gpointer) serv);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 1, 0, 1, 1);
|
||||
gtk_widget_set_hexpand (wid, TRUE);
|
||||
chanlist_grid_attach (table, wid, 1, 0, 1, 1, TRUE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_CENTER);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 1, 2, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, 0, 0, 0);
|
||||
@@ -1132,7 +1159,8 @@ chanlist_opengui (server *serv, int do_refresh)
|
||||
|
||||
wid = gtk_vseparator_new ();
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), wid, 2, 0, 1, 5);
|
||||
chanlist_grid_attach (table, wid, 2, 0, 1, 5, FALSE, FALSE,
|
||||
GTK_ALIGN_FILL, GTK_ALIGN_FILL);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), wid, 2, 3, 0, 5,
|
||||
GTK_SHRINK | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
|
||||
@@ -764,22 +764,30 @@ dcc_detail_label (char *text, GtkWidget *box, int num)
|
||||
g_snprintf (buf, sizeof (buf), "<b>%s</b>", text);
|
||||
gtk_label_set_markup (GTK_LABEL (label), buf);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (label, FALSE);
|
||||
gtk_widget_set_vexpand (label, FALSE);
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label, GTK_ALIGN_START);
|
||||
gtk_table_attach (GTK_TABLE (box), label, 0, 1, 0 + num, 1 + num, 0, 0, 0, 0);
|
||||
#elif !HAVE_GTK3
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (box), label, 0, 1, 0 + num, 1 + num,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
gtk_table_attach (GTK_TABLE (box), label, 0, 1, 0 + num, 1 + num, GTK_FILL, GTK_FILL, 0, 0);
|
||||
|
||||
label = gtk_label_new (NULL);
|
||||
gtk_label_set_selectable (GTK_LABEL (label), TRUE);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (label, FALSE);
|
||||
gtk_widget_set_vexpand (label, FALSE);
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label, GTK_ALIGN_START);
|
||||
gtk_table_attach (GTK_TABLE (box), label, 1, 2, 0 + num, 1 + num, 0, 0, 0, 0);
|
||||
#elif !HAVE_GTK3
|
||||
gtk_misc_set_alignment (GTK_MISC (label), 0, 0);
|
||||
gtk_table_attach (GTK_TABLE (box), label, 1, 2, 0 + num, 1 + num,
|
||||
GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
gtk_table_attach (GTK_TABLE (box), label, 1, 2, 0 + num, 1 + num, GTK_FILL, GTK_FILL, 0, 0);
|
||||
|
||||
return label;
|
||||
}
|
||||
@@ -880,22 +888,54 @@ fe_dcc_open_recv_win (int passive)
|
||||
radio = gtk_radio_button_new_with_mnemonic (NULL, _("Both"));
|
||||
g_signal_connect (G_OBJECT (radio), "toggled",
|
||||
G_CALLBACK (dcc_toggle), GINT_TO_POINTER (VIEW_BOTH));
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (radio, FALSE);
|
||||
gtk_widget_set_vexpand (radio, FALSE);
|
||||
gtk_widget_set_halign (radio, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (radio, GTK_ALIGN_FILL);
|
||||
gtk_table_attach (GTK_TABLE (table), radio, 3, 4, 0, 1, 0, 0, 0, 0);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), radio, 3, 4, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio));
|
||||
|
||||
radio = gtk_radio_button_new_with_mnemonic (group, _("Uploads"));
|
||||
g_signal_connect (G_OBJECT (radio), "toggled",
|
||||
G_CALLBACK (dcc_toggle), GINT_TO_POINTER (VIEW_UPLOAD));
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (radio, FALSE);
|
||||
gtk_widget_set_vexpand (radio, FALSE);
|
||||
gtk_widget_set_halign (radio, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (radio, GTK_ALIGN_FILL);
|
||||
gtk_table_attach (GTK_TABLE (table), radio, 1, 2, 0, 1, 0, 0, 0, 0);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), radio, 1, 2, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
group = gtk_radio_button_get_group (GTK_RADIO_BUTTON (radio));
|
||||
|
||||
radio = gtk_radio_button_new_with_mnemonic (group, _("Downloads"));
|
||||
g_signal_connect (G_OBJECT (radio), "toggled",
|
||||
G_CALLBACK (dcc_toggle), GINT_TO_POINTER (VIEW_DOWNLOAD));
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (radio, FALSE);
|
||||
gtk_widget_set_vexpand (radio, FALSE);
|
||||
gtk_widget_set_halign (radio, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (radio, GTK_ALIGN_FILL);
|
||||
gtk_table_attach (GTK_TABLE (table), radio, 2, 3, 0, 1, 0, 0, 0, 0);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), radio, 2, 3, 0, 1, GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
exp = gtk_expander_new (_("Details"));
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (exp, TRUE);
|
||||
gtk_widget_set_vexpand (exp, FALSE);
|
||||
gtk_widget_set_halign (exp, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (exp, GTK_ALIGN_FILL);
|
||||
gtk_table_attach (GTK_TABLE (table), exp, 0, 1, 0, 1, 0, 0, 0, 0);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), exp, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
detailbox = gtk_table_new (3, 3, FALSE);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (detailbox), 6);
|
||||
@@ -903,7 +943,15 @@ fe_dcc_open_recv_win (int passive)
|
||||
gtk_container_set_border_width (GTK_CONTAINER (detailbox), 6);
|
||||
g_signal_connect (G_OBJECT (exp), "activate",
|
||||
G_CALLBACK (dcc_exp_cb), detailbox);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (detailbox, TRUE);
|
||||
gtk_widget_set_vexpand (detailbox, FALSE);
|
||||
gtk_widget_set_halign (detailbox, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (detailbox, GTK_ALIGN_FILL);
|
||||
gtk_table_attach (GTK_TABLE (table), detailbox, 0, 4, 1, 2, 0, 0, 0, 0);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), detailbox, 0, 4, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0);
|
||||
#endif
|
||||
|
||||
dccfwin.file_label = dcc_detail_label (_("File:"), detailbox, 0);
|
||||
dccfwin.address_label = dcc_detail_label (_("Address:"), detailbox, 1);
|
||||
|
||||
@@ -1403,6 +1403,10 @@ mg_open_quit_dialog (gboolean minimize_button)
|
||||
#endif
|
||||
gtk_widget_show (image);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (image, FALSE);
|
||||
gtk_widget_set_vexpand (image, FALSE);
|
||||
gtk_widget_set_halign (image, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (image, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (table1), image, 0, 0, 1, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table1), image, 0, 1, 0, 1,
|
||||
@@ -1413,10 +1417,11 @@ mg_open_quit_dialog (gboolean minimize_button)
|
||||
checkbutton1 = gtk_check_button_new_with_mnemonic (_("Don't ask next time."));
|
||||
gtk_widget_show (checkbutton1);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table1), checkbutton1, 0, 1, 2, 1);
|
||||
gtk_widget_set_hexpand (checkbutton1, TRUE);
|
||||
gtk_widget_set_vexpand (checkbutton1, FALSE);
|
||||
gtk_widget_set_halign (checkbutton1, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (checkbutton1, GTK_ALIGN_CENTER);
|
||||
gtk_grid_attach (GTK_GRID (table1), checkbutton1, 0, 1, 2, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table1), checkbutton1, 0, 2, 1, 2,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
@@ -1434,9 +1439,9 @@ mg_open_quit_dialog (gboolean minimize_button)
|
||||
gtk_widget_show (label);
|
||||
mg_set_label_alignment_start (label);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table1), label, 1, 0, 1, 1);
|
||||
gtk_widget_set_hexpand (label, TRUE);
|
||||
gtk_widget_set_vexpand (label, TRUE);
|
||||
gtk_grid_attach (GTK_GRID (table1), label, 1, 0, 1, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table1), label, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_SHRINK | GTK_FILL),
|
||||
@@ -1971,11 +1976,11 @@ mg_userlist_button (GtkWidget * box, char *label, char *cmd,
|
||||
g_signal_connect (G_OBJECT (wid), "clicked",
|
||||
G_CALLBACK (userlist_button_cb), cmd);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (box), wid, a, c, b - a, d - c);
|
||||
gtk_widget_set_hexpand (wid, TRUE);
|
||||
gtk_widget_set_vexpand (wid, TRUE);
|
||||
gtk_widget_set_halign (wid, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (wid, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (box), wid, a, c, b - a, d - c);
|
||||
#else
|
||||
gtk_table_attach_defaults (GTK_TABLE (box), wid, a, b, c, d);
|
||||
#endif
|
||||
@@ -2962,6 +2967,10 @@ mg_place_userlist_and_chanview_real (session_gui *gui, GtkWidget *userlist, GtkW
|
||||
case POS_TOP:
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_margin_bottom (chanview, GUI_SPACING - 1);
|
||||
gtk_widget_set_hexpand (chanview, FALSE);
|
||||
gtk_widget_set_vexpand (chanview, FALSE);
|
||||
gtk_widget_set_halign (chanview, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (chanview, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (gui->main_table), chanview,
|
||||
1, 1, 1, 1);
|
||||
#else
|
||||
@@ -2975,6 +2984,10 @@ mg_place_userlist_and_chanview_real (session_gui *gui, GtkWidget *userlist, GtkW
|
||||
/* always attach it to something to avoid ref_count=0 */
|
||||
if (prefs.hex_gui_ulist_pos == POS_TOP)
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (chanview, FALSE);
|
||||
gtk_widget_set_vexpand (chanview, FALSE);
|
||||
gtk_widget_set_halign (chanview, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (chanview, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (gui->main_table), chanview,
|
||||
1, 3, 1, 1);
|
||||
#else
|
||||
@@ -2984,6 +2997,10 @@ mg_place_userlist_and_chanview_real (session_gui *gui, GtkWidget *userlist, GtkW
|
||||
|
||||
else
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (chanview, FALSE);
|
||||
gtk_widget_set_vexpand (chanview, FALSE);
|
||||
gtk_widget_set_halign (chanview, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (chanview, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (gui->main_table), chanview,
|
||||
1, 1, 1, 1);
|
||||
#else
|
||||
@@ -2994,6 +3011,10 @@ mg_place_userlist_and_chanview_real (session_gui *gui, GtkWidget *userlist, GtkW
|
||||
default:/* POS_BOTTOM */
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_margin_top (chanview, 3);
|
||||
gtk_widget_set_hexpand (chanview, FALSE);
|
||||
gtk_widget_set_vexpand (chanview, FALSE);
|
||||
gtk_widget_set_halign (chanview, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (chanview, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (gui->main_table), chanview,
|
||||
1, 3, 1, 1);
|
||||
#else
|
||||
@@ -3660,9 +3681,11 @@ mg_create_menu (session_gui *gui, GtkWidget *table, int away_state)
|
||||
gui->menu = menu_create_main (accel_group, TRUE, away_state, !gui->is_tab,
|
||||
gui->menu_item);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), gui->menu, 0, 0, 3, 1);
|
||||
gtk_widget_set_hexpand (gui->menu, TRUE);
|
||||
gtk_widget_set_vexpand (gui->menu, FALSE);
|
||||
gtk_widget_set_halign (gui->menu, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (gui->menu, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (table), gui->menu, 0, 0, 3, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), gui->menu, 0, 3, 0, 1,
|
||||
GTK_EXPAND | GTK_FILL, GTK_SHRINK | GTK_FILL, 0, 0);
|
||||
@@ -3677,9 +3700,11 @@ mg_create_irctab (session *sess, GtkWidget *table)
|
||||
|
||||
vbox = mg_box_new (GTK_ORIENTATION_VERTICAL, FALSE, 0);
|
||||
#if HAVE_GTK3
|
||||
gtk_grid_attach (GTK_GRID (table), vbox, 1, 2, 1, 1);
|
||||
gtk_widget_set_hexpand (vbox, TRUE);
|
||||
gtk_widget_set_vexpand (vbox, TRUE);
|
||||
gtk_widget_set_halign (vbox, GTK_ALIGN_FILL);
|
||||
gtk_widget_set_valign (vbox, GTK_ALIGN_FILL);
|
||||
gtk_grid_attach (GTK_GRID (table), vbox, 1, 2, 1, 1);
|
||||
#else
|
||||
gtk_table_attach (GTK_TABLE (table), vbox, 1, 2, 2, 3,
|
||||
GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0);
|
||||
|
||||
@@ -1282,6 +1282,73 @@ servlist_check_cb (GtkWidget *but, gpointer num_p)
|
||||
}
|
||||
}
|
||||
|
||||
typedef enum
|
||||
{
|
||||
SERVLIST_ALIGN_START,
|
||||
SERVLIST_ALIGN_CENTER,
|
||||
SERVLIST_ALIGN_FILL
|
||||
} servlist_align;
|
||||
|
||||
#if HAVE_GTK3
|
||||
static GtkAlign
|
||||
servlist_align_to_gtk (servlist_align align)
|
||||
{
|
||||
switch (align)
|
||||
{
|
||||
case SERVLIST_ALIGN_FILL:
|
||||
return GTK_ALIGN_FILL;
|
||||
case SERVLIST_ALIGN_CENTER:
|
||||
return GTK_ALIGN_CENTER;
|
||||
case SERVLIST_ALIGN_START:
|
||||
default:
|
||||
return GTK_ALIGN_START;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
servlist_table_attach (GtkWidget *table, GtkWidget *child,
|
||||
guint left_attach, guint right_attach,
|
||||
guint top_attach, guint bottom_attach,
|
||||
gboolean hexpand, gboolean vexpand,
|
||||
servlist_align halign, servlist_align valign,
|
||||
guint xpad, guint ypad)
|
||||
{
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_hexpand (child, hexpand);
|
||||
gtk_widget_set_vexpand (child, vexpand);
|
||||
gtk_widget_set_halign (child, servlist_align_to_gtk (halign));
|
||||
gtk_widget_set_valign (child, servlist_align_to_gtk (valign));
|
||||
gtk_widget_set_margin_start (child, xpad);
|
||||
gtk_widget_set_margin_end (child, xpad);
|
||||
gtk_widget_set_margin_top (child, ypad);
|
||||
gtk_widget_set_margin_bottom (child, ypad);
|
||||
gtk_table_attach (GTK_TABLE (table), child, left_attach, right_attach,
|
||||
top_attach, bottom_attach, 0, 0, 0, 0);
|
||||
#else
|
||||
GtkAttachOptions xoptions = 0;
|
||||
GtkAttachOptions yoptions = 0;
|
||||
|
||||
if (hexpand)
|
||||
xoptions |= GTK_EXPAND;
|
||||
else
|
||||
xoptions |= GTK_SHRINK;
|
||||
if (halign == SERVLIST_ALIGN_FILL)
|
||||
xoptions |= GTK_FILL;
|
||||
|
||||
if (vexpand)
|
||||
yoptions |= GTK_EXPAND;
|
||||
else
|
||||
yoptions |= GTK_SHRINK;
|
||||
if (valign == SERVLIST_ALIGN_FILL)
|
||||
yoptions |= GTK_FILL;
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), child, left_attach, right_attach,
|
||||
top_attach, bottom_attach, xoptions, yoptions,
|
||||
xpad, ypad);
|
||||
#endif
|
||||
}
|
||||
|
||||
static GtkWidget *
|
||||
servlist_create_check (int num, int state, GtkWidget *table, int row, int col, char *labeltext)
|
||||
{
|
||||
@@ -1291,7 +1358,10 @@ servlist_create_check (int num, int state, GtkWidget *table, int row, int col, c
|
||||
gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (but), state);
|
||||
g_signal_connect (G_OBJECT (but), "toggled",
|
||||
G_CALLBACK (servlist_check_cb), GINT_TO_POINTER (num));
|
||||
gtk_table_attach (GTK_TABLE (table), but, col, col+2, row, row+1, GTK_FILL|GTK_EXPAND, 0, SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
|
||||
servlist_table_attach (table, but, col, col + 2, row, row + 1,
|
||||
TRUE, FALSE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_CENTER,
|
||||
SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
|
||||
gtk_widget_show (but);
|
||||
|
||||
return but;
|
||||
@@ -1307,7 +1377,10 @@ servlist_create_entry (GtkWidget *table, char *labeltext, int row,
|
||||
if (label_ret)
|
||||
*label_ret = label;
|
||||
gtk_widget_show (label);
|
||||
gtk_table_attach (GTK_TABLE (table), label, 0, 1, row, row+1, GTK_FILL, 0, SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
|
||||
servlist_table_attach (table, label, 0, 1, row, row + 1,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_START, SERVLIST_ALIGN_CENTER,
|
||||
SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_halign (label, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
|
||||
@@ -1321,7 +1394,10 @@ servlist_create_entry (GtkWidget *table, char *labeltext, int row,
|
||||
gtk_entry_set_text (GTK_ENTRY (entry), def ? def : "");
|
||||
gtk_label_set_mnemonic_widget (GTK_LABEL (label), entry);
|
||||
|
||||
gtk_table_attach (GTK_TABLE (table), entry, 1, 2, row, row+1, GTK_FILL|GTK_EXPAND, 0, SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
|
||||
servlist_table_attach (table, entry, 1, 2, row, row + 1,
|
||||
TRUE, FALSE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_CENTER,
|
||||
SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
|
||||
|
||||
return entry;
|
||||
}
|
||||
@@ -1980,7 +2056,10 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
|
||||
edit_entry_user = servlist_create_entry (table3, _("_User name:"), 9, net->user, &edit_label_user, 0);
|
||||
|
||||
label_logintype = gtk_label_new (_("Login method:"));
|
||||
gtk_table_attach (GTK_TABLE (table3), label_logintype, 0, 1, 10, 11, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
|
||||
servlist_table_attach (table3, label_logintype, 0, 1, 10, 11,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_START, SERVLIST_ALIGN_CENTER,
|
||||
SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_halign (label_logintype, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label_logintype, GTK_ALIGN_CENTER);
|
||||
@@ -1988,7 +2067,10 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
|
||||
gtk_misc_set_alignment (GTK_MISC (label_logintype), 0, 0.5);
|
||||
#endif
|
||||
combobox_logintypes = servlist_create_logintypecombo (notebook);
|
||||
gtk_table_attach (GTK_TABLE (table3), combobox_logintypes, 1, 2, 10, 11, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 4, 2);
|
||||
servlist_table_attach (table3, combobox_logintypes, 1, 2, 10, 11,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_FILL,
|
||||
4, 2);
|
||||
|
||||
edit_entry_pass = servlist_create_entry (table3, _("Password:"), 11, net->pass, 0, _("Password used for login. If in doubt, leave blank."));
|
||||
gtk_entry_set_visibility (GTK_ENTRY (edit_entry_pass), FALSE);
|
||||
@@ -1996,7 +2078,10 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
|
||||
gtk_widget_set_sensitive (edit_entry_pass, FALSE);
|
||||
|
||||
label34 = gtk_label_new (_("Character set:"));
|
||||
gtk_table_attach (GTK_TABLE (table3), label34, 0, 1, 12, 13, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
|
||||
servlist_table_attach (table3, label34, 0, 1, 12, 13,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_START, SERVLIST_ALIGN_CENTER,
|
||||
SERVLIST_X_PADDING, SERVLIST_Y_PADDING);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_halign (label34, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label34, GTK_ALIGN_CENTER);
|
||||
@@ -2004,7 +2089,10 @@ servlist_open_edit (GtkWidget *parent, ircnet *net)
|
||||
gtk_misc_set_alignment (GTK_MISC (label34), 0, 0.5);
|
||||
#endif
|
||||
comboboxentry_charset = servlist_create_charsetcombo ();
|
||||
gtk_table_attach (GTK_TABLE (table3), comboboxentry_charset, 1, 2, 12, 13, (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (GTK_FILL), 4, 2);
|
||||
servlist_table_attach (table3, comboboxentry_charset, 1, 2, 12, 13,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_FILL,
|
||||
4, 2);
|
||||
|
||||
|
||||
/* Rule and Close button */
|
||||
@@ -2114,9 +2202,10 @@ servlist_open_networks (void)
|
||||
|
||||
label3 = gtk_label_new_with_mnemonic (_("_Nick name:"));
|
||||
gtk_widget_show (label3);
|
||||
gtk_table_attach (GTK_TABLE (table1), label3, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
servlist_table_attach (table1, label3, 0, 1, 0, 1,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_START, SERVLIST_ALIGN_CENTER,
|
||||
0, 0);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_halign (label3, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label3, GTK_ALIGN_CENTER);
|
||||
@@ -2126,9 +2215,10 @@ servlist_open_networks (void)
|
||||
|
||||
label4 = gtk_label_new (_("Second choice:"));
|
||||
gtk_widget_show (label4);
|
||||
gtk_table_attach (GTK_TABLE (table1), label4, 0, 1, 1, 2,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
servlist_table_attach (table1, label4, 0, 1, 1, 2,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_START, SERVLIST_ALIGN_CENTER,
|
||||
0, 0);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_halign (label4, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label4, GTK_ALIGN_CENTER);
|
||||
@@ -2138,9 +2228,10 @@ servlist_open_networks (void)
|
||||
|
||||
label5 = gtk_label_new (_("Third choice:"));
|
||||
gtk_widget_show (label5);
|
||||
gtk_table_attach (GTK_TABLE (table1), label5, 0, 1, 2, 3,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
servlist_table_attach (table1, label5, 0, 1, 2, 3,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_START, SERVLIST_ALIGN_CENTER,
|
||||
0, 0);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_halign (label5, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label5, GTK_ALIGN_CENTER);
|
||||
@@ -2150,9 +2241,10 @@ servlist_open_networks (void)
|
||||
|
||||
label6 = gtk_label_new_with_mnemonic (_("_User name:"));
|
||||
gtk_widget_show (label6);
|
||||
gtk_table_attach (GTK_TABLE (table1), label6, 0, 1, 3, 4,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
servlist_table_attach (table1, label6, 0, 1, 3, 4,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_START, SERVLIST_ALIGN_CENTER,
|
||||
0, 0);
|
||||
#if HAVE_GTK3
|
||||
gtk_widget_set_halign (label6, GTK_ALIGN_START);
|
||||
gtk_widget_set_valign (label6, GTK_ALIGN_CENTER);
|
||||
@@ -2170,30 +2262,34 @@ servlist_open_networks (void)
|
||||
entry_nick1 = entry1 = gtk_entry_new ();
|
||||
gtk_entry_set_text (GTK_ENTRY (entry1), prefs.hex_irc_nick1);
|
||||
gtk_widget_show (entry1);
|
||||
gtk_table_attach (GTK_TABLE (table1), entry1, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
servlist_table_attach (table1, entry1, 1, 2, 0, 1,
|
||||
TRUE, FALSE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_CENTER,
|
||||
0, 0);
|
||||
|
||||
entry_nick2 = entry2 = gtk_entry_new ();
|
||||
gtk_entry_set_text (GTK_ENTRY (entry2), prefs.hex_irc_nick2);
|
||||
gtk_widget_show (entry2);
|
||||
gtk_table_attach (GTK_TABLE (table1), entry2, 1, 2, 1, 2,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
servlist_table_attach (table1, entry2, 1, 2, 1, 2,
|
||||
TRUE, FALSE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_CENTER,
|
||||
0, 0);
|
||||
|
||||
entry_nick3 = entry3 = gtk_entry_new ();
|
||||
gtk_entry_set_text (GTK_ENTRY (entry3), prefs.hex_irc_nick3);
|
||||
gtk_widget_show (entry3);
|
||||
gtk_table_attach (GTK_TABLE (table1), entry3, 1, 2, 2, 3,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
servlist_table_attach (table1, entry3, 1, 2, 2, 3,
|
||||
TRUE, FALSE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_CENTER,
|
||||
0, 0);
|
||||
|
||||
entry_guser = entry4 = gtk_entry_new ();
|
||||
gtk_entry_set_text (GTK_ENTRY (entry4), prefs.hex_irc_user_name);
|
||||
gtk_widget_show (entry4);
|
||||
gtk_table_attach (GTK_TABLE (table1), entry4, 1, 2, 3, 4,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
servlist_table_attach (table1, entry4, 1, 2, 3, 4,
|
||||
TRUE, FALSE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_CENTER,
|
||||
0, 0);
|
||||
|
||||
/* entry_greal = entry5 = gtk_entry_new ();
|
||||
gtk_entry_set_text (GTK_ENTRY (entry5), prefs.hex_irc_real_name);
|
||||
@@ -2222,9 +2318,10 @@ servlist_open_networks (void)
|
||||
|
||||
scrolledwindow3 = gtk_scrolled_window_new (NULL, NULL);
|
||||
gtk_widget_show (scrolledwindow3);
|
||||
gtk_table_attach (GTK_TABLE (table4), scrolledwindow3, 0, 1, 0, 1,
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_EXPAND | GTK_FILL), 0, 0);
|
||||
servlist_table_attach (table4, scrolledwindow3, 0, 1, 0, 1,
|
||||
TRUE, TRUE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_FILL,
|
||||
0, 0);
|
||||
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow3),
|
||||
GTK_POLICY_NEVER, GTK_POLICY_ALWAYS);
|
||||
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolledwindow3),
|
||||
@@ -2256,9 +2353,10 @@ servlist_open_networks (void)
|
||||
#elif !HAVE_GTK3
|
||||
hbox = gtk_hbox_new (0, FALSE);
|
||||
#endif
|
||||
gtk_table_attach (GTK_TABLE (table4), hbox, 0, 2, 1, 2,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (0), 0, 0);
|
||||
servlist_table_attach (table4, hbox, 0, 2, 1, 2,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_CENTER,
|
||||
0, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
checkbutton_skip =
|
||||
@@ -2283,9 +2381,10 @@ servlist_open_networks (void)
|
||||
gtk_box_set_spacing (GTK_BOX (vbuttonbox2), 3);
|
||||
gtk_button_box_set_layout (GTK_BUTTON_BOX (vbuttonbox2), GTK_BUTTONBOX_START);
|
||||
gtk_widget_show (vbuttonbox2);
|
||||
gtk_table_attach (GTK_TABLE (table4), vbuttonbox2, 1, 2, 0, 1,
|
||||
(GtkAttachOptions) (GTK_FILL),
|
||||
(GtkAttachOptions) (GTK_FILL), 0, 0);
|
||||
servlist_table_attach (table4, vbuttonbox2, 1, 2, 0, 1,
|
||||
FALSE, FALSE,
|
||||
SERVLIST_ALIGN_FILL, SERVLIST_ALIGN_FILL,
|
||||
0, 0);
|
||||
|
||||
#if HAVE_GTK3
|
||||
button_add = servlist_icon_button_new (_("_Add"), ICON_SERVLIST_ADD);
|
||||
|
||||
Reference in New Issue
Block a user