[gimp] libgimp: also size prop switch widget's label as GimpLabeled's labels.



commit 673f490a951b42710eba02b1ff2004582a8e3a1a
Author: Jehan <jehan girinstud io>
Date:   Fri Nov 13 20:24:08 2020 +0100

    libgimp: also size prop switch widget's label as GimpLabeled's labels.
    
    To get nice rendering with labels and edit widgets aligned, add the prop
    switch label into the same size group.

 libgimp/gimpproceduredialog.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/libgimp/gimpproceduredialog.c b/libgimp/gimpproceduredialog.c
index 60530a2168..067f7a5c71 100644
--- a/libgimp/gimpproceduredialog.c
+++ b/libgimp/gimpproceduredialog.c
@@ -325,6 +325,7 @@ gimp_procedure_dialog_get_widget (GimpProcedureDialog *dialog,
                                   GType                widget_type)
 {
   GtkWidget  *widget = NULL;
+  GtkWidget  *label  = NULL;
   GParamSpec *pspec;
 
   g_return_val_if_fail (property != NULL, NULL);
@@ -351,10 +352,10 @@ gimp_procedure_dialog_get_widget (GimpProcedureDialog *dialog,
                                              property,
                                              _(g_param_spec_get_nick (pspec)));
       else if (widget_type == GTK_TYPE_SWITCH)
-          widget = gimp_prop_switch_new (G_OBJECT (dialog->priv->config),
-                                         property,
-                                         _(g_param_spec_get_nick (pspec)),
-                                         NULL, NULL);
+        widget = gimp_prop_switch_new (G_OBJECT (dialog->priv->config),
+                                       property,
+                                       _(g_param_spec_get_nick (pspec)),
+                                       &label, NULL);
     }
   else if (G_PARAM_SPEC_TYPE (pspec) == G_TYPE_PARAM_INT)
     {
@@ -403,9 +404,10 @@ gimp_procedure_dialog_get_widget (GimpProcedureDialog *dialog,
                  property, G_PARAM_SPEC_TYPE_NAME (pspec));
       return NULL;
     }
-  else if (GIMP_IS_LABELED (widget))
+  else if (GIMP_IS_LABELED (widget) || label)
     {
-      GtkWidget *label = gimp_labeled_get_label (GIMP_LABELED (widget));
+      if (! label)
+        label = gimp_labeled_get_label (GIMP_LABELED (widget));
 
       gtk_size_group_add_widget (dialog->priv->label_group, label);
     }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]