moved the call to gimp_color_tool_enable() from GimpTool::initialize() to

2003-09-19  Michael Natterer  <mitch@gimp.org>

	* app/tools/gimpcolorpickertool.c: moved the call to
	gimp_color_tool_enable() from GimpTool::initialize() to
	GObject::constructor() so the right cursor is shown before the
	first button_press. Fixes bug #122693.
This commit is contained in:
Michael Natterer 2003-09-19 12:11:04 +00:00 committed by Michael Natterer
parent d6a606b9fc
commit da6c31af1f
2 changed files with 41 additions and 24 deletions

View file

@ -1,3 +1,10 @@
2003-09-19 Michael Natterer <mitch@gimp.org>
* app/tools/gimpcolorpickertool.c: moved the call to
gimp_color_tool_enable() from GimpTool::initialize() to
GObject::constructor() so the right cursor is shown before the
first button_press. Fixes bug #122693.
2003-09-19 Sven Neumann <sven@gimp.org>
* app/widgets/gimpcolormapeditor.c: changed the hex entry to look

View file

@ -59,10 +59,11 @@
static void gimp_color_picker_tool_class_init (GimpColorPickerToolClass *klass);
static void gimp_color_picker_tool_init (GimpColorPickerTool *tool);
static GObject * gimp_color_picker_tool_constructor(GType type,
guint n_params,
GObjectConstructParam *params);
static void gimp_color_picker_tool_finalize (GObject *object);
static void gimp_color_picker_tool_initialize (GimpTool *tool,
GimpDisplay *gdisp);
static void gimp_color_picker_tool_control (GimpTool *tool,
GimpToolAction action,
GimpDisplay *gdisp);
@ -149,12 +150,12 @@ gimp_color_picker_tool_class_init (GimpColorPickerToolClass *klass)
parent_class = g_type_class_peek_parent (klass);
object_class->finalize = gimp_color_picker_tool_finalize;
object_class->constructor = gimp_color_picker_tool_constructor;
object_class->finalize = gimp_color_picker_tool_finalize;
tool_class->initialize = gimp_color_picker_tool_initialize;
tool_class->control = gimp_color_picker_tool_control;
tool_class->control = gimp_color_picker_tool_control;
color_tool_class->picked = gimp_color_picker_tool_picked;
color_tool_class->picked = gimp_color_picker_tool_picked;
}
static void
@ -162,10 +163,30 @@ gimp_color_picker_tool_init (GimpColorPickerTool *tool)
{
gimp_tool_control_set_preserve (GIMP_TOOL (tool)->control, FALSE);
gimp_tool_control_set_cursor (GIMP_TOOL (tool)->control,
GIMP_COLOR_PICKER_CURSOR);
gimp_tool_control_set_tool_cursor (GIMP_TOOL (tool)->control,
GIMP_COLOR_PICKER_TOOL_CURSOR);
}
static GObject *
gimp_color_picker_tool_constructor (GType type,
guint n_params,
GObjectConstructParam *params)
{
GObject *object;
GimpTool *tool;
object = G_OBJECT_CLASS (parent_class)->constructor (type, n_params, params);
tool = GIMP_TOOL (object);
gimp_color_tool_enable (GIMP_COLOR_TOOL (object),
GIMP_COLOR_OPTIONS (tool->tool_info->tool_options));
return object;
}
static void
gimp_color_picker_tool_finalize (GObject *object)
{
@ -173,24 +194,12 @@ gimp_color_picker_tool_finalize (GObject *object)
{
info_dialog_free (gimp_color_picker_tool_info);
gimp_color_picker_tool_info = NULL;
color_area = NULL;
}
G_OBJECT_CLASS (parent_class)->finalize (object);
}
static void
gimp_color_picker_tool_initialize (GimpTool *tool,
GimpDisplay *gdisp)
{
GIMP_TOOL_CLASS (parent_class)->initialize (tool, gdisp);
/* always pick colors */
gimp_color_tool_enable (GIMP_COLOR_TOOL (tool),
GIMP_COLOR_OPTIONS (tool->tool_info->tool_options));
}
static void
gimp_color_picker_tool_control (GimpTool *tool,
GimpToolAction action,
@ -203,6 +212,7 @@ gimp_color_picker_tool_control (GimpTool *tool,
{
info_dialog_free (gimp_color_picker_tool_info);
gimp_color_picker_tool_info = NULL;
color_area = NULL;
}
break;