Updated the DCC transfer view and notify dialog to use GtkGrid with GTK3 spacing and attachment equivalents while keeping GTK2 table behavior intact.

Switched GTK3 layout helpers and table sections in the server list and setup UI to grid-based attachments and spacing for consistent GTK3 behavior.
This commit is contained in:
2026-01-30 17:13:44 -07:00
parent 3a8a9332d6
commit af2678a3a0
4 changed files with 106 additions and 15 deletions

View File

@@ -393,38 +393,65 @@ fe_notify_ask (char *nick, char *networks)
gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent_window));
gtk_window_set_position (GTK_WINDOW (dialog), GTK_WIN_POS_MOUSE);
#if HAVE_GTK3
table = gtk_grid_new ();
gtk_container_set_border_width (GTK_CONTAINER (table), 12);
gtk_grid_set_row_spacing (GTK_GRID (table), 3);
gtk_grid_set_column_spacing (GTK_GRID (table), 8);
#else
table = gtk_table_new (2, 3, FALSE);
gtk_container_set_border_width (GTK_CONTAINER (table), 12);
gtk_table_set_row_spacings (GTK_TABLE (table), 3);
gtk_table_set_col_spacings (GTK_TABLE (table), 8);
#endif
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), table);
label = gtk_label_new (msg);
#if HAVE_GTK3
gtk_grid_attach (GTK_GRID (table), label, 0, 0, 1, 1);
#else
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 0, 1);
#endif
entry = gtk_entry_new ();
gtk_entry_set_text (GTK_ENTRY (entry), nick);
g_signal_connect (G_OBJECT (entry), "activate",
G_CALLBACK (notifygui_add_enter), dialog);
#if HAVE_GTK3
gtk_grid_attach (GTK_GRID (table), entry, 1, 0, 1, 1);
#else
gtk_table_attach_defaults (GTK_TABLE (table), entry, 1, 2, 0, 1);
#endif
g_signal_connect (G_OBJECT (dialog), "response",
G_CALLBACK (notifygui_add_cb), entry);
label = gtk_label_new (_("Notify on these networks:"));
#if HAVE_GTK3
gtk_grid_attach (GTK_GRID (table), label, 0, 2, 1, 1);
#else
gtk_table_attach_defaults (GTK_TABLE (table), label, 0, 1, 2, 3);
#endif
wid = gtk_entry_new ();
g_object_set_data (G_OBJECT (entry), "net", wid);
g_signal_connect (G_OBJECT (wid), "activate",
G_CALLBACK (notifygui_add_enter), dialog);
gtk_entry_set_text (GTK_ENTRY (wid), networks ? networks : "ALL");
#if HAVE_GTK3
gtk_grid_attach (GTK_GRID (table), wid, 1, 2, 1, 1);
#else
gtk_table_attach_defaults (GTK_TABLE (table), wid, 1, 2, 2, 3);
#endif
label = gtk_label_new (NULL);
g_snprintf (buf, sizeof (buf), "<i><span size=\"smaller\">%s</span></i>", _("Comma separated list of networks is accepted."));
gtk_label_set_markup (GTK_LABEL (label), buf);
#if HAVE_GTK3
gtk_grid_attach (GTK_GRID (table), label, 1, 3, 1, 1);
#else
gtk_table_attach_defaults (GTK_TABLE (table), label, 1, 2, 3, 4);
#endif
gtk_widget_show_all (dialog);
}