app: check "gradient-repeat" sensitivity at Blend Options creation.

When starting the tool with one of the gradient types for which the
repeat option should be deactivated, it is not. Run the handler function
once at GUI creation.
Also compare the gradient type with an enum value, which makes the test
clearer than using an int.
This commit is contained in:
Jehan 2018-03-14 18:57:45 +01:00
parent 5751bb114e
commit 11ce60ba3d
1 changed files with 3 additions and 1 deletions

View File

@ -291,6 +291,7 @@ gimp_blend_options_gui (GimpToolOptions *tool_options)
g_signal_connect (config, "notify::gradient-type",
G_CALLBACK (blend_options_gradient_type_notify),
combo);
blend_options_gradient_type_notify (options, NULL, combo);
/* the offset scale */
scale = gimp_prop_spin_scale_new (config, "offset", NULL,
@ -374,5 +375,6 @@ blend_options_gradient_type_notify (GimpBlendOptions *options,
GParamSpec *pspec,
GtkWidget *repeat_combo)
{
gtk_widget_set_sensitive (repeat_combo, options->gradient_type < 6);
gtk_widget_set_sensitive (repeat_combo,
options->gradient_type < GIMP_GRADIENT_SHAPEBURST_ANGULAR);
}