diff --git a/ChangeLog b/ChangeLog index 0fade88da7..6fd188dec7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-05-06 Michael Natterer + + * app/tools/gimppainttool.c: connect to the context's + "brush-changed" signal and update the brush core's brush + accordingly. Fixes inconsistent brush preview when not moving + the mouse while the brush changes (bug #323404). + 2006-05-06 Michael Natterer * app/core/gimpparamspecs.[ch]: added "gboolean none_ok" members diff --git a/app/tools/gimpbrushtool.c b/app/tools/gimpbrushtool.c index 4f4d6690d1..895c170cb7 100644 --- a/app/tools/gimpbrushtool.c +++ b/app/tools/gimpbrushtool.c @@ -107,6 +107,9 @@ static void gimp_paint_tool_color_picked (GimpColorTool *color_tool, GimpRGB *color, gint color_index); +static void gimp_paint_tool_brush_changed (GimpContext *context, + GimpBrush *brush, + GimpPaintTool *paint_tool); static void gimp_paint_tool_set_brush (GimpBrushCore *brush_core, GimpBrush *brush, GimpPaintTool *paint_tool); @@ -211,9 +214,13 @@ gimp_paint_tool_constructor (GType type, if (GIMP_IS_BRUSH_CORE (paint_tool->core)) { - g_signal_connect (paint_tool->core, "set-brush", - G_CALLBACK (gimp_paint_tool_set_brush), - paint_tool); + g_signal_connect_object (tool->tool_info->tool_options, "brush-changed", + G_CALLBACK (gimp_paint_tool_brush_changed), + paint_tool, 0); + + g_signal_connect (paint_tool->core, "set-brush", + G_CALLBACK (gimp_paint_tool_set_brush), + paint_tool); g_signal_connect_after (paint_tool->core, "set-brush", G_CALLBACK (gimp_paint_tool_set_brush_after), paint_tool); @@ -870,6 +877,17 @@ gimp_paint_tool_color_picked (GimpColorTool *color_tool, } } +static void +gimp_paint_tool_brush_changed (GimpContext *context, + GimpBrush *brush, + GimpPaintTool *paint_tool) +{ + GimpBrushCore *brush_core = GIMP_BRUSH_CORE (paint_tool->core); + + if (brush_core->main_brush != brush) + gimp_brush_core_set_brush (brush_core, brush); +} + static void gimp_paint_tool_set_brush (GimpBrushCore *brush_core, GimpBrush *brush, diff --git a/app/tools/gimppainttool.c b/app/tools/gimppainttool.c index 4f4d6690d1..895c170cb7 100644 --- a/app/tools/gimppainttool.c +++ b/app/tools/gimppainttool.c @@ -107,6 +107,9 @@ static void gimp_paint_tool_color_picked (GimpColorTool *color_tool, GimpRGB *color, gint color_index); +static void gimp_paint_tool_brush_changed (GimpContext *context, + GimpBrush *brush, + GimpPaintTool *paint_tool); static void gimp_paint_tool_set_brush (GimpBrushCore *brush_core, GimpBrush *brush, GimpPaintTool *paint_tool); @@ -211,9 +214,13 @@ gimp_paint_tool_constructor (GType type, if (GIMP_IS_BRUSH_CORE (paint_tool->core)) { - g_signal_connect (paint_tool->core, "set-brush", - G_CALLBACK (gimp_paint_tool_set_brush), - paint_tool); + g_signal_connect_object (tool->tool_info->tool_options, "brush-changed", + G_CALLBACK (gimp_paint_tool_brush_changed), + paint_tool, 0); + + g_signal_connect (paint_tool->core, "set-brush", + G_CALLBACK (gimp_paint_tool_set_brush), + paint_tool); g_signal_connect_after (paint_tool->core, "set-brush", G_CALLBACK (gimp_paint_tool_set_brush_after), paint_tool); @@ -870,6 +877,17 @@ gimp_paint_tool_color_picked (GimpColorTool *color_tool, } } +static void +gimp_paint_tool_brush_changed (GimpContext *context, + GimpBrush *brush, + GimpPaintTool *paint_tool) +{ + GimpBrushCore *brush_core = GIMP_BRUSH_CORE (paint_tool->core); + + if (brush_core->main_brush != brush) + gimp_brush_core_set_brush (brush_core, brush); +} + static void gimp_paint_tool_set_brush (GimpBrushCore *brush_core, GimpBrush *brush,