plug-ins: fix #15274 Imagemap create guides dialog is too wide

The create guides dialog of the imagemap plug-in shows up very wide
due to the hint text not being wrapped.

To fix this we enclose the hint box inside a scrolled window and set
horizontal policy to GTK_POLICY_EXTERNAL and a minimum vertical size
of 100, based on how we do this in the export procedure dialog for
the comment field.
This commit is contained in:
Jacob Boerema 2026-02-18 10:01:51 -05:00
parent 03f3b1a741
commit 04f3030371

View file

@ -129,11 +129,12 @@ recalc_bounds(GtkWidget *widget, gpointer data)
static GuidesDialog_t*
make_guides_dialog (void)
{
GuidesDialog_t *data = g_new(GuidesDialog_t, 1);
GuidesDialog_t *data = g_new(GuidesDialog_t, 1);
DefaultDialog_t *dialog;
GtkWidget *grid;
GtkWidget *label;
GtkWidget *hbox;
GtkWidget *grid;
GtkWidget *label;
GtkWidget *hbox;
GtkWidget *scrolled_window;
dialog = data->dialog = make_default_dialog(_("Create Guides"));
default_dialog_set_ok_cb (dialog, guides_ok_cb, data);
@ -143,7 +144,16 @@ make_guides_dialog (void)
"them by their width, height, and spacing from each other. This "
"allows you to rapidly create the most common image map type - "
"image collection of \"thumbnails\", suitable for navigation bars."));
gtk_box_pack_start (GTK_BOX (dialog->vbox), hbox, FALSE, FALSE, 0);
scrolled_window = gtk_scrolled_window_new (NULL, NULL);
gtk_widget_set_size_request (scrolled_window, -1, 100);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
GTK_POLICY_EXTERNAL, GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER (dialog->vbox), scrolled_window);
gtk_widget_show (scrolled_window);
gtk_widget_set_hexpand (hbox, TRUE);
gtk_widget_set_vexpand (hbox, TRUE);
gtk_container_add (GTK_CONTAINER (scrolled_window), hbox);
gtk_widget_show (hbox);
data->image_dimensions = gtk_label_new ("");