libgimp: make sure alignment and margin are same for all argument labels.

While fixing individual widget's labels to have proper default is good,
let's also have a centralized re-setting of alignment and margins for
all the labels which we set in the same GtkSizeGroup. This makes nice
and consistent dialogs.

Additionally I set a 4px margin at the end of label (0 elsewhere),
otherwise the longer label in the size group end up sticking too close
to its control widget and it's ugly.
This commit is contained in:
Jehan
2025-01-26 21:29:21 +01:00
parent dd15b6a9a3
commit a353618d53

View File

@ -940,8 +940,18 @@ gimp_procedure_dialog_get_widget (GimpProcedureDialog *dialog,
else if (GIMP_IS_DRAWABLE_CHOOSER (widget))
label = gimp_drawable_chooser_get_label (GIMP_DRAWABLE_CHOOSER (widget));
}
if (label != NULL)
gtk_size_group_add_widget (priv->label_group, label);
{
gtk_size_group_add_widget (priv->label_group, label);
/* Make sure all labels have consistent alignment and margin. */
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_margin_end (GTK_WIDGET (label), 4);
gtk_widget_set_margin_start (GTK_WIDGET (label), 0);
gtk_widget_set_margin_top (GTK_WIDGET (label), 0);
gtk_widget_set_margin_bottom (GTK_WIDGET (label), 0);
}
}
if ((binding = g_hash_table_lookup (priv->sensitive_data, property)))