connect to the context's "brush-changed" signal and update the brush

2006-05-06  Michael Natterer  <mitch@gimp.org>

	* 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).
This commit is contained in:
Michael Natterer 2006-05-06 21:10:32 +00:00 committed by Michael Natterer
parent 549df3a0df
commit c2061e2922
3 changed files with 49 additions and 6 deletions

View File

@ -1,3 +1,10 @@
2006-05-06 Michael Natterer <mitch@gimp.org>
* 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 <mitch@gimp.org> 2006-05-06 Michael Natterer <mitch@gimp.org>
* app/core/gimpparamspecs.[ch]: added "gboolean none_ok" members * app/core/gimpparamspecs.[ch]: added "gboolean none_ok" members

View File

@ -107,6 +107,9 @@ static void gimp_paint_tool_color_picked (GimpColorTool *color_tool,
GimpRGB *color, GimpRGB *color,
gint color_index); 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, static void gimp_paint_tool_set_brush (GimpBrushCore *brush_core,
GimpBrush *brush, GimpBrush *brush,
GimpPaintTool *paint_tool); GimpPaintTool *paint_tool);
@ -211,6 +214,10 @@ gimp_paint_tool_constructor (GType type,
if (GIMP_IS_BRUSH_CORE (paint_tool->core)) if (GIMP_IS_BRUSH_CORE (paint_tool->core))
{ {
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_signal_connect (paint_tool->core, "set-brush",
G_CALLBACK (gimp_paint_tool_set_brush), G_CALLBACK (gimp_paint_tool_set_brush),
paint_tool); 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 static void
gimp_paint_tool_set_brush (GimpBrushCore *brush_core, gimp_paint_tool_set_brush (GimpBrushCore *brush_core,
GimpBrush *brush, GimpBrush *brush,

View File

@ -107,6 +107,9 @@ static void gimp_paint_tool_color_picked (GimpColorTool *color_tool,
GimpRGB *color, GimpRGB *color,
gint color_index); 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, static void gimp_paint_tool_set_brush (GimpBrushCore *brush_core,
GimpBrush *brush, GimpBrush *brush,
GimpPaintTool *paint_tool); GimpPaintTool *paint_tool);
@ -211,6 +214,10 @@ gimp_paint_tool_constructor (GType type,
if (GIMP_IS_BRUSH_CORE (paint_tool->core)) if (GIMP_IS_BRUSH_CORE (paint_tool->core))
{ {
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_signal_connect (paint_tool->core, "set-brush",
G_CALLBACK (gimp_paint_tool_set_brush), G_CALLBACK (gimp_paint_tool_set_brush),
paint_tool); 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 static void
gimp_paint_tool_set_brush (GimpBrushCore *brush_core, gimp_paint_tool_set_brush (GimpBrushCore *brush_core,
GimpBrush *brush, GimpBrush *brush,