[gimp] libgimpwidgets: add back some GEGL prop special-casing in…



commit 75f9bdccbb684423c20d02b917a9dbe5a659575a
Author: Jehan <jehan girinstud io>
Date:   Sat Apr 9 21:53:32 2022 +0200

    libgimpwidgets: add back some GEGL prop special-casing in…
    
    … gimp_prop_spin_scale_new().
    
    This was forgotten when moving the code to libgimpwidgets in commit
    7056f1b960. Thanks to Thomas Manni for noticing.

 libgimpwidgets/gimppropwidgets.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
---
diff --git a/libgimpwidgets/gimppropwidgets.c b/libgimpwidgets/gimppropwidgets.c
index d6469ae4d4..1736123ecd 100644
--- a/libgimpwidgets/gimppropwidgets.c
+++ b/libgimpwidgets/gimppropwidgets.c
@@ -20,6 +20,7 @@
 #include <string.h>
 
 #include <gegl.h>
+#include <gegl-paramspecs.h>
 #include <gtk/gtk.h>
 
 #include "libgimpcolor/gimpcolor.h"
@@ -1546,6 +1547,23 @@ gimp_prop_spin_scale_new (GObject     *config,
 
   set_param_spec (G_OBJECT (adjustment), spinscale, param_spec);
 
+  if (GEGL_IS_PARAM_SPEC_DOUBLE (param_spec))
+    {
+      GeglParamSpecDouble *gspec = GEGL_PARAM_SPEC_DOUBLE (param_spec);
+
+      gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (spinscale),
+                                        gspec->ui_minimum, gspec->ui_maximum);
+      gimp_spin_scale_set_gamma (GIMP_SPIN_SCALE (spinscale), gspec->ui_gamma);
+    }
+  else if (GEGL_IS_PARAM_SPEC_INT (param_spec))
+    {
+      GeglParamSpecInt *gspec = GEGL_PARAM_SPEC_INT (param_spec);
+
+      gimp_spin_scale_set_scale_limits (GIMP_SPIN_SCALE (spinscale),
+                                        gspec->ui_minimum, gspec->ui_maximum);
+      gimp_spin_scale_set_gamma (GIMP_SPIN_SCALE (spinscale), gspec->ui_gamma);
+    }
+
   tooltip = g_param_spec_get_blurb (param_spec);
   gimp_help_set_help_data (spinscale, tooltip, NULL);
 


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