Issue #11422: gimp_prop_widget_new_from_pspec: not supported: GeglParamColor

In all core code, transform GeglParamColor to GimpParamColor with alpha.
This commit is contained in:
Jehan 2024-08-02 18:06:59 +02:00
parent 048b2c437d
commit 318342039d
2 changed files with 20 additions and 1 deletions

View File

@ -24,6 +24,7 @@
#include <gdk-pixbuf/gdk-pixbuf.h>
#include "libgimpbase/gimpbase.h"
#include "libgimpcolor/gimpcolor.h"
#include "libgimpconfig/gimpconfig.h"
#include "operations-types.h"
@ -150,7 +151,20 @@ gimp_operation_config_get_type (Gimp *gimp,
strcmp (pspec->name, "input") &&
strcmp (pspec->name, "output"))
{
pspecs[j] = pspec;
if (GEGL_IS_PARAM_SPEC_COLOR (pspec))
/* As special exception, let's transform GeglParamColor
* into GimpParamColor in all core code. This way, we
* have one less param type to handle.
*/
pspecs[j] = gimp_param_spec_color (pspec->name,
g_param_spec_get_nick (pspec),
g_param_spec_get_blurb (pspec),
TRUE,
gegl_param_spec_color_get_default (pspec),
pspec->flags);
else
pspecs[j] = pspec;
j++;
}
}

View File

@ -142,6 +142,11 @@ gimp_config_class_init (GObjectClass *klass,
if (copy)
{
g_object_class_install_property (klass, i + 1, copy);
/* If the original param spec was floating, this would unref
* it. Otherwise (e.g. it's a spec taken from another object),
* nothing happens.
*/
g_param_spec_sink (pspec);
}
else
{