From a353618d539287bbd1a7eb551a8104df13055a8e Mon Sep 17 00:00:00 2001 From: Jehan Date: Sun, 26 Jan 2025 21:29:21 +0100 Subject: [PATCH] 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. --- libgimp/gimpproceduredialog.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libgimp/gimpproceduredialog.c b/libgimp/gimpproceduredialog.c index b9e6806d5a..6b29a29ea0 100644 --- a/libgimp/gimpproceduredialog.c +++ b/libgimp/gimpproceduredialog.c @@ -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)))