Top | ![]() |
![]() |
![]() |
![]() |
GtkWidget * | gwy_gradient_swatch_new () |
void | gwy_gradient_swatch_set_gradient () |
GwyGradient * | gwy_gradient_swatch_get_gradient () |
void | gwy_gradient_swatch_set_use_alpha () |
gboolean | gwy_gradient_swatch_get_use_alpha () |
void | gwy_gradient_swatch_set_editable () |
gboolean | gwy_gradient_swatch_get_editable () |
void | gwy_gradient_swatch_set_has_marker () |
gboolean | gwy_gradient_swatch_get_has_marker () |
void | gwy_gradient_swatch_set_adjustment () |
GtkAdjustment * | gwy_gradient_swatch_get_adjustment () |
GtkAdjustment * | adjustment | Read / Write |
gboolean | editable | Read / Write |
GwyGradient * | gradient | Read / Write |
gboolean | has-marker | Read / Write |
gboolean | use-alpha | Read / Write |
The widget is a simple rectangle displaying a colour gradient, with some support for visualisation of the alpha value.
void gwy_gradient_swatch_set_gradient (GwyGradientSwatch *swatch
,GwyGradient *gradient
);
Sets the current gradient of a gradient swatch.
The gradient can be NULL
. The default gradient is then displayed, although it is not terribly useful.
GwyGradient *
gwy_gradient_swatch_get_gradient (GwyGradientSwatch *swatch
);
Obtains the current gradient displayed by a gradient swatch.
void gwy_gradient_swatch_set_use_alpha (GwyGradientSwatch *swatch
,gboolean use_alpha
);
Sets whether a gradient swatch should use the alpha channel.
gboolean
gwy_gradient_swatch_get_use_alpha (GwyGradientSwatch *swatch
);
Reports whether a gradient swatch uses the alpha channel.
void gwy_gradient_swatch_set_editable (GwyGradientSwatch *swatch
,gboolean editable
);
Sets whether a gradient swatch adjustment is user editable.
Making the swatch editable permits the user to move the marker. It is possible, although possibly confusing to the user, to make the swatch editable while keeping the marker disabled. It will respond identically as if the marker was visible.
gboolean
gwy_gradient_swatch_get_editable (GwyGradientSwatch *swatch
);
Reports whether a gradient swatch is user editable.
void gwy_gradient_swatch_set_has_marker (GwyGradientSwatch *swatch
,gboolean has_marker
);
Sets whether a gradient swatch should have a marker.
Use gwy_gradient_swatch_set_editable()
to make the marker user-editable or passive. By default, the marker is
passive.
gboolean
gwy_gradient_swatch_get_has_marker (GwyGradientSwatch *swatch
);
Reports whether a gradient swatch should have a marker.
void gwy_gradient_swatch_set_adjustment (GwyGradientSwatch *swatch
,GtkAdjustment *adj
);
Sets the adjustment used for the editable marker of a gradient swatch.
Often the implicitly created adjustment is sufficient. If you do not set any adjustment and enable a marker or
editability, an implicit adjustment with [0,1] range is created. It is also created when you pass NULL
as adj
and the swatch already has a marker or is editable.
GtkAdjustment *
gwy_gradient_swatch_get_adjustment (GwyGradientSwatch *swatch
);
Gets the adjustment used for the editable marker of a gradient swatch.
Connect to the returned adjustment to watch marker movement. If the gradient swatch has never had an editable
marker (nor any adjustment set explicitly) the function can return NULL
.
“adjustment”
property“adjustment” GtkAdjustment *
Adjustment used with the marker.
Owner: GwyGradientSwatch
Flags: Read / Write
“editable”
property “editable” gboolean
Whether the adjustment is user-editable.
Owner: GwyGradientSwatch
Flags: Read / Write
Default value: FALSE
“gradient”
property“gradient” GwyGradient *
Color gradient to display.
Owner: GwyGradientSwatch
Flags: Read / Write
“has-marker”
property “has-marker” gboolean
Whether the swatch has a marker.
Owner: GwyGradientSwatch
Flags: Read / Write
Default value: FALSE