app: separate handling of reverse-gradient from paint dynamics
because it belongs to the gradient and should be changed whenever the gradient gets changed. Introduce gimp_paint_options_copy_gradient_props() and call it at the right places in the tool manager.
This commit is contained in:
@ -745,19 +745,16 @@ gimp_paint_options_copy_dynamics_props (GimpPaintOptions *src,
|
||||
GimpUnit fade_unit;
|
||||
GimpRepeatMode fade_repeat;
|
||||
|
||||
gboolean gradient_reverse;
|
||||
|
||||
g_return_if_fail (GIMP_IS_PAINT_OPTIONS (src));
|
||||
g_return_if_fail (GIMP_IS_PAINT_OPTIONS (dest));
|
||||
|
||||
g_object_get (src,
|
||||
"dynamics-expanded", &dynamics_expanded,
|
||||
"fade-reverse", &fade_reverse,
|
||||
"fade-length", &fade_length,
|
||||
"fade-unit", &fade_unit,
|
||||
"fade-repeat", &fade_repeat,
|
||||
"gradient-reverse", &gradient_reverse,
|
||||
NULL);
|
||||
g_object_get (src,
|
||||
"dynamics-expanded", &dynamics_expanded,
|
||||
"fade-reverse", &fade_reverse,
|
||||
"fade-length", &fade_length,
|
||||
"fade-unit", &fade_unit,
|
||||
"fade-repeat", &fade_repeat,
|
||||
NULL);
|
||||
|
||||
g_object_set (dest,
|
||||
"dynamics-expanded", dynamics_expanded,
|
||||
@ -765,7 +762,23 @@ gimp_paint_options_copy_dynamics_props (GimpPaintOptions *src,
|
||||
"fade-length", fade_length,
|
||||
"fade-unit", fade_unit,
|
||||
"fade-repeat", fade_repeat,
|
||||
"gradient-reverse", gradient_reverse,
|
||||
NULL);
|
||||
}
|
||||
|
||||
void
|
||||
gimp_paint_options_copy_gradient_props (GimpPaintOptions *src,
|
||||
GimpPaintOptions *dest)
|
||||
{
|
||||
gboolean gradient_reverse;
|
||||
|
||||
g_return_if_fail (GIMP_IS_PAINT_OPTIONS (src));
|
||||
g_return_if_fail (GIMP_IS_PAINT_OPTIONS (dest));
|
||||
|
||||
g_object_get (src,
|
||||
"gradient-reverse", &gradient_reverse,
|
||||
NULL);
|
||||
|
||||
g_object_set (dest,
|
||||
"gradient-reverse", gradient_reverse,
|
||||
NULL);
|
||||
}
|
||||
|
@ -131,12 +131,12 @@ gboolean gimp_paint_options_get_gradient_color (GimpPaintOptions *paint_options,
|
||||
GimpBrushApplicationMode
|
||||
gimp_paint_options_get_brush_mode (GimpPaintOptions *paint_options);
|
||||
|
||||
void gimp_paint_options_copy_brush_props (GimpPaintOptions *src,
|
||||
void gimp_paint_options_copy_brush_props (GimpPaintOptions *src,
|
||||
GimpPaintOptions *dest);
|
||||
|
||||
void gimp_paint_options_copy_dynamics_props (GimpPaintOptions *src,
|
||||
GimpPaintOptions *dest);
|
||||
|
||||
void gimp_paint_options_copy_gradient_props (GimpPaintOptions *src,
|
||||
GimpPaintOptions *dest);
|
||||
|
||||
|
||||
#endif /* __GIMP_PAINT_OPTIONS_H__ */
|
||||
|
@ -679,6 +679,10 @@ tool_manager_preset_changed (GimpContext *user_context,
|
||||
if (config->global_dynamics && preset->use_dynamics)
|
||||
gimp_paint_options_copy_dynamics_props (GIMP_PAINT_OPTIONS (src),
|
||||
GIMP_PAINT_OPTIONS (dest));
|
||||
|
||||
if (config->global_gradient && preset->use_gradient)
|
||||
gimp_paint_options_copy_gradient_props (GIMP_PAINT_OPTIONS (src),
|
||||
GIMP_PAINT_OPTIONS (dest));
|
||||
}
|
||||
}
|
||||
|
||||
@ -743,6 +747,10 @@ tool_manager_connect_options (GimpToolManager *tool_manager,
|
||||
if (config->global_dynamics)
|
||||
gimp_paint_options_copy_dynamics_props (tool_manager->shared_paint_options,
|
||||
GIMP_PAINT_OPTIONS (tool_info->tool_options));
|
||||
|
||||
if (config->global_gradient)
|
||||
gimp_paint_options_copy_gradient_props (tool_manager->shared_paint_options,
|
||||
GIMP_PAINT_OPTIONS (tool_info->tool_options));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -764,6 +772,9 @@ tool_manager_disconnect_options (GimpToolManager *tool_manager,
|
||||
|
||||
gimp_paint_options_copy_dynamics_props (GIMP_PAINT_OPTIONS (tool_info->tool_options),
|
||||
tool_manager->shared_paint_options);
|
||||
|
||||
gimp_paint_options_copy_gradient_props (GIMP_PAINT_OPTIONS (tool_info->tool_options),
|
||||
tool_manager->shared_paint_options);
|
||||
}
|
||||
|
||||
gimp_context_set_parent (GIMP_CONTEXT (tool_info->tool_options), NULL);
|
||||
|
Reference in New Issue
Block a user