app: respect GEGLs ui-range hints for properties
This commit is contained in:

committed by
Michael Natterer

parent
eb2e658408
commit
1cee8d79bf
@ -97,6 +97,22 @@ gimp_param_spec_duplicate (GParamSpec *pspec)
|
||||
spec->default_value,
|
||||
pspec->flags);
|
||||
}
|
||||
else if (GEGL_IS_PARAM_SPEC_DOUBLE (pspec))
|
||||
{
|
||||
GeglParamSpecDouble *gspec = GEGL_PARAM_SPEC_DOUBLE (pspec);
|
||||
GParamSpecDouble *spec = G_PARAM_SPEC_DOUBLE (pspec);
|
||||
|
||||
return gegl_param_spec_double (pspec->name,
|
||||
g_param_spec_get_nick (pspec),
|
||||
g_param_spec_get_blurb (pspec),
|
||||
spec->minimum,
|
||||
spec->maximum,
|
||||
spec->default_value,
|
||||
gspec->ui_minimum,
|
||||
gspec->ui_maximum,
|
||||
gspec->ui_gamma,
|
||||
pspec->flags);
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_DOUBLE (pspec))
|
||||
{
|
||||
GParamSpecDouble *spec = G_PARAM_SPEC_DOUBLE (pspec);
|
||||
@ -121,6 +137,21 @@ gimp_param_spec_duplicate (GParamSpec *pspec)
|
||||
spec->default_value,
|
||||
pspec->flags);
|
||||
}
|
||||
else if (GEGL_IS_PARAM_SPEC_INT (pspec))
|
||||
{
|
||||
GeglParamSpecInt *gspec = GEGL_PARAM_SPEC_INT (pspec);
|
||||
GParamSpecInt *spec = G_PARAM_SPEC_INT (pspec);
|
||||
|
||||
return gegl_param_spec_int (pspec->name,
|
||||
g_param_spec_get_nick (pspec),
|
||||
g_param_spec_get_blurb (pspec),
|
||||
spec->minimum,
|
||||
spec->maximum,
|
||||
spec->default_value,
|
||||
gspec->ui_minimum,
|
||||
gspec->ui_maximum,
|
||||
pspec->flags);
|
||||
}
|
||||
else if (G_IS_PARAM_SPEC_INT (pspec))
|
||||
{
|
||||
GParamSpecInt *spec = G_PARAM_SPEC_INT (pspec);
|
||||
|
@ -25,6 +25,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <gegl.h>
|
||||
#include <gegl-paramspecs.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "libgimpcolor/gimpcolor.h"
|
||||
@ -507,6 +508,19 @@ gimp_prop_spin_scale_new (GObject *config,
|
||||
|
||||
set_param_spec (G_OBJECT (adjustment), scale, param_spec);
|
||||
|
||||
if (GEGL_IS_PARAM_SPEC_DOUBLE (param_spec))
|
||||
{
|
||||
GeglParamSpecDouble *gspec = GEGL_PARAM_SPEC_DOUBLE (param_spec);
|
||||
gimp_spin_scale_set_scale_limits (scale, gspec->ui_minimum, gspec->ui_maximum);
|
||||
}
|
||||
|
||||
if (GEGL_IS_PARAM_SPEC_INT (param_spec))
|
||||
{
|
||||
GeglParamSpecInt *gspec = GEGL_PARAM_SPEC_INT (param_spec);
|
||||
gimp_spin_scale_set_scale_limits (scale, gspec->ui_minimum, gspec->ui_maximum);
|
||||
}
|
||||
|
||||
|
||||
g_signal_connect (adjustment, "value-changed",
|
||||
G_CALLBACK (gimp_prop_adjustment_callback),
|
||||
config);
|
||||
|
Reference in New Issue
Block a user