Commit 3f7b1182 authored by Michael Natterer's avatar Michael Natterer Committed by Michael Natterer

cursors/Makefile.am cursors/modifier-bad.png

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

	* cursors/Makefile.am
	* cursors/modifier-bad.png
	* cursors/xbm/modifier-bad-mask.xbm
	* cursors/xbm/modifier-bad.xbm: new "bad" cursor
	modifier. Replaces the "bad" cursor.

	* cursors/gimp-tool-cursors.xcf: added it here too.

	* app/widgets/widgets-enums.h: added GIMP_CURSOR_MODIFIER_BAD.

	* app/widgets/gimpcursor.c: add the bad modifier. Leave the bad
	cursor there for now.

	* app/display/gimpdisplayshell-callbacks.c
	* app/tools/gimpaligntool.c
	* app/tools/gimpblendtool.c
	* app/tools/gimpbycolorselecttool.c
	* app/tools/gimpclonetool.c
	* app/tools/gimpcolortool.c
	* app/tools/gimpfliptool.c
	* app/tools/gimpiscissorstool.c
	* app/tools/gimpmovetool.c
	* app/tools/gimptransformtool.c
	* app/tools/gimpvectortool.c: use the modifier instead of the
	cursor. Fixes hotspot jumping when switching between normal and
	bad cursors. The changed cursor_update() functions even make more
	sense IMHO. Fixes bug #158407.
parent 6c25ae93
2006-06-01 Michael Natterer <mitch@gimp.org>
* cursors/Makefile.am
* cursors/modifier-bad.png
* cursors/xbm/modifier-bad-mask.xbm
* cursors/xbm/modifier-bad.xbm: new "bad" cursor
modifier. Replaces the "bad" cursor.
* cursors/gimp-tool-cursors.xcf: added it here too.
* app/widgets/widgets-enums.h: added GIMP_CURSOR_MODIFIER_BAD.
* app/widgets/gimpcursor.c: add the bad modifier. Leave the bad
cursor there for now.
* app/display/gimpdisplayshell-callbacks.c
* app/tools/gimpaligntool.c
* app/tools/gimpblendtool.c
* app/tools/gimpbycolorselecttool.c
* app/tools/gimpclonetool.c
* app/tools/gimpcolortool.c
* app/tools/gimpfliptool.c
* app/tools/gimpiscissorstool.c
* app/tools/gimpmovetool.c
* app/tools/gimptransformtool.c
* app/tools/gimpvectortool.c: use the modifier instead of the
cursor. Fixes hotspot jumping when switching between normal and
bad cursors. The changed cursor_update() functions even make more
sense IMHO. Fixes bug #158407.
2006-06-01 Sven Neumann <sven@gimp.org> 2006-06-01 Sven Neumann <sven@gimp.org>
Added basic framework for plug-ins to access the use_cpu_accel Added basic framework for plug-ins to access the use_cpu_accel
......
...@@ -652,17 +652,17 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, ...@@ -652,17 +652,17 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
! gimp_tool_control_get_handle_empty_image (active_tool->control)) ! gimp_tool_control_get_handle_empty_image (active_tool->control))
{ {
gimp_display_shell_set_cursor (shell, gimp_display_shell_set_cursor (shell,
GIMP_CURSOR_BAD, GIMP_CURSOR_MOUSE,
gimp_tool_control_get_tool_cursor (active_tool->control), gimp_tool_control_get_tool_cursor (active_tool->control),
GIMP_CURSOR_MODIFIER_NONE); GIMP_CURSOR_MODIFIER_BAD);
} }
} }
else else
{ {
gimp_display_shell_set_cursor (shell, gimp_display_shell_set_cursor (shell,
GIMP_CURSOR_BAD, GIMP_CURSOR_MOUSE,
GIMP_TOOL_CURSOR_NONE, GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE); GIMP_CURSOR_MODIFIER_BAD);
} }
shell->button_press_before_focus = TRUE; shell->button_press_before_focus = TRUE;
...@@ -1342,17 +1342,17 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas, ...@@ -1342,17 +1342,17 @@ gimp_display_shell_canvas_tool_events (GtkWidget *canvas,
! gimp_tool_control_get_handle_empty_image (active_tool->control)) ! gimp_tool_control_get_handle_empty_image (active_tool->control))
{ {
gimp_display_shell_set_cursor (shell, gimp_display_shell_set_cursor (shell,
GIMP_CURSOR_BAD, GIMP_CURSOR_MOUSE,
gimp_tool_control_get_tool_cursor (active_tool->control), gimp_tool_control_get_tool_cursor (active_tool->control),
GIMP_CURSOR_MODIFIER_NONE); GIMP_CURSOR_MODIFIER_BAD);
} }
} }
else else
{ {
gimp_display_shell_set_cursor (shell, gimp_display_shell_set_cursor (shell,
GIMP_CURSOR_BAD, GIMP_CURSOR_MOUSE,
GIMP_TOOL_CURSOR_NONE, GIMP_TOOL_CURSOR_NONE,
GIMP_CURSOR_MODIFIER_NONE); GIMP_CURSOR_MODIFIER_BAD);
} }
} }
......
...@@ -392,51 +392,52 @@ gimp_align_tool_cursor_update (GimpTool *tool, ...@@ -392,51 +392,52 @@ gimp_align_tool_cursor_update (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *display) GimpDisplay *display)
{ {
GimpAlignOptions *options = GIMP_ALIGN_OPTIONS (tool->tool_info->tool_options); GimpAlignOptions *options;
GimpCursorType cursor = GIMP_CURSOR_MOUSE;
GimpCursorType cursor = GIMP_CURSOR_BAD;
GimpToolCursorType tool_cursor = GIMP_TOOL_CURSOR_MOVE; GimpToolCursorType tool_cursor = GIMP_TOOL_CURSOR_MOVE;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
options = GIMP_ALIGN_OPTIONS (tool->tool_info->tool_options);
if (options->align_type == GIMP_TRANSFORM_TYPE_PATH) if (options->align_type == GIMP_TRANSFORM_TYPE_PATH)
{ {
tool_cursor = GIMP_TOOL_CURSOR_PATHS; tool_cursor = GIMP_TOOL_CURSOR_PATHS;
modifier = GIMP_CURSOR_MODIFIER_MOVE;
if (gimp_draw_tool_on_vectors (GIMP_DRAW_TOOL (tool), display, if (gimp_draw_tool_on_vectors (GIMP_DRAW_TOOL (tool), display,
coords, 7, 7, coords, 7, 7,
NULL, NULL, NULL, NULL, NULL, NULL)) NULL, NULL, NULL, NULL, NULL, NULL))
{ {
cursor = GIMP_CURSOR_MOUSE;
tool_cursor = GIMP_TOOL_CURSOR_HAND; tool_cursor = GIMP_TOOL_CURSOR_HAND;
modifier = GIMP_CURSOR_MODIFIER_MOVE;
}
else
{
modifier = GIMP_CURSOR_MODIFIER_BAD;
} }
} }
else else
{ {
GimpLayer *layer; GimpLayer *layer = gimp_image_pick_correlate_layer (display->image,
coords->x, coords->y);
if ((layer = gimp_image_pick_correlate_layer (display->image, if (layer)
coords->x, coords->y)))
{ {
/* if there is a floating selection, and this aint it... */ /* if there is a floating selection, and this aint it... */
if (gimp_image_floating_sel (display->image) && if (gimp_image_floating_sel (display->image) &&
! gimp_layer_is_floating_sel (layer)) ! gimp_layer_is_floating_sel (layer))
{ {
cursor = GIMP_CURSOR_MOUSE; modifier = GIMP_CURSOR_MODIFIER_ANCHOR;
tool_cursor = GIMP_TOOL_CURSOR_MOVE;
modifier = GIMP_CURSOR_MODIFIER_ANCHOR;
} }
else if (layer == gimp_image_get_active_layer (display->image)) else if (layer != gimp_image_get_active_layer (display->image))
{ {
cursor = GIMP_CURSOR_MOUSE;
}
else
{
cursor = GIMP_CURSOR_MOUSE;
tool_cursor = GIMP_TOOL_CURSOR_HAND; tool_cursor = GIMP_TOOL_CURSOR_HAND;
modifier = GIMP_CURSOR_MODIFIER_MOVE; modifier = GIMP_CURSOR_MODIFIER_MOVE;
} }
} }
else
{
modifier = GIMP_CURSOR_MODIFIER_BAD;
}
} }
gimp_tool_control_set_cursor (tool->control, cursor); gimp_tool_control_set_cursor (tool->control, cursor);
......
...@@ -121,6 +121,8 @@ gimp_blend_tool_init (GimpBlendTool *blend_tool) ...@@ -121,6 +121,8 @@ gimp_blend_tool_init (GimpBlendTool *blend_tool)
GimpTool *tool = GIMP_TOOL (blend_tool); GimpTool *tool = GIMP_TOOL (blend_tool);
gimp_tool_control_set_scroll_lock (tool->control, TRUE); gimp_tool_control_set_scroll_lock (tool->control, TRUE);
gimp_tool_control_set_cursor (tool->control,
GIMP_CURSOR_MOUSE);
gimp_tool_control_set_tool_cursor (tool->control, gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_BLEND); GIMP_TOOL_CURSOR_BLEND);
gimp_tool_control_set_action_value_1 (tool->control, gimp_tool_control_set_action_value_1 (tool->control,
...@@ -276,10 +278,12 @@ gimp_blend_tool_cursor_update (GimpTool *tool, ...@@ -276,10 +278,12 @@ gimp_blend_tool_cursor_update (GimpTool *tool,
{ {
case GIMP_INDEXED_IMAGE: case GIMP_INDEXED_IMAGE:
case GIMP_INDEXEDA_IMAGE: case GIMP_INDEXEDA_IMAGE:
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD); gimp_tool_control_set_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_BAD);
break; break;
default: default:
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE); gimp_tool_control_set_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_NONE);
break; break;
} }
......
...@@ -100,6 +100,10 @@ gimp_by_color_select_tool_class_init (GimpByColorSelectToolClass *klass) ...@@ -100,6 +100,10 @@ gimp_by_color_select_tool_class_init (GimpByColorSelectToolClass *klass)
static void static void
gimp_by_color_select_tool_init (GimpByColorSelectTool *by_color_select) gimp_by_color_select_tool_init (GimpByColorSelectTool *by_color_select)
{ {
GimpTool *tool = GIMP_TOOL (by_color_select);
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE);
by_color_select->x = 0; by_color_select->x = 0;
by_color_select->y = 0; by_color_select->y = 0;
} }
...@@ -248,11 +252,13 @@ gimp_by_color_select_tool_cursor_update (GimpTool *tool, ...@@ -248,11 +252,13 @@ gimp_by_color_select_tool_cursor_update (GimpTool *tool,
if (! options->sample_merged && if (! options->sample_merged &&
layer && layer != display->image->active_layer) layer && layer != display->image->active_layer)
{ {
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD); gimp_tool_control_set_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_BAD);
} }
else else
{ {
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE); gimp_tool_control_set_cursor_modifier (tool->control,
GIMP_CURSOR_MODIFIER_NONE);
} }
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
......
...@@ -209,8 +209,9 @@ gimp_clone_tool_cursor_update (GimpTool *tool, ...@@ -209,8 +209,9 @@ gimp_clone_tool_cursor_update (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *display) GimpDisplay *display)
{ {
GimpCloneOptions *options; GimpCloneOptions *options;
GimpCursorType ctype = GIMP_CURSOR_MOUSE; GimpCursorType cursor = GIMP_CURSOR_MOUSE;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options); options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options);
...@@ -224,18 +225,25 @@ gimp_clone_tool_cursor_update (GimpTool *tool, ...@@ -224,18 +225,25 @@ gimp_clone_tool_cursor_update (GimpTool *tool,
if (gimp_channel_is_empty (selection) || if (gimp_channel_is_empty (selection) ||
gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection), gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection),
coords->x, coords->y)) coords->x, coords->y))
ctype = GIMP_CURSOR_MOUSE; {
cursor = GIMP_CURSOR_MOUSE;
}
} }
if (options->clone_type == GIMP_IMAGE_CLONE) if (options->clone_type == GIMP_IMAGE_CLONE)
{ {
if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK) if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
ctype = GIMP_CURSOR_CROSSHAIR_SMALL; {
cursor = GIMP_CURSOR_CROSSHAIR_SMALL;
}
else if (! GIMP_CLONE (GIMP_PAINT_TOOL (tool)->core)->src_drawable) else if (! GIMP_CLONE (GIMP_PAINT_TOOL (tool)->core)->src_drawable)
ctype = GIMP_CURSOR_BAD; {
modifier = GIMP_CURSOR_MODIFIER_BAD;
}
} }
gimp_tool_control_set_cursor (tool->control, ctype); gimp_tool_control_set_cursor (tool->control, cursor);
gimp_tool_control_set_cursor_modifier (tool->control, modifier);
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
} }
......
...@@ -504,8 +504,7 @@ gimp_color_tool_cursor_update (GimpTool *tool, ...@@ -504,8 +504,7 @@ gimp_color_tool_cursor_update (GimpTool *tool,
} }
else else
{ {
GimpCursorType cursor = GIMP_CURSOR_BAD; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_BAD;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
if (coords->x > 0 && coords->x < display->image->width && if (coords->x > 0 && coords->x < display->image->width &&
coords->y > 0 && coords->y < display->image->height && coords->y > 0 && coords->y < display->image->height &&
...@@ -513,27 +512,26 @@ gimp_color_tool_cursor_update (GimpTool *tool, ...@@ -513,27 +512,26 @@ gimp_color_tool_cursor_update (GimpTool *tool,
(color_tool->options->sample_merged || (color_tool->options->sample_merged ||
gimp_image_coords_in_active_drawable (display->image, coords))) gimp_image_coords_in_active_drawable (display->image, coords)))
{ {
cursor = GIMP_CURSOR_MOUSE; switch (color_tool->pick_mode)
} {
case GIMP_COLOR_PICK_MODE_NONE:
switch (color_tool->pick_mode) modifier = GIMP_CURSOR_MODIFIER_NONE;
{ break;
case GIMP_COLOR_PICK_MODE_NONE: case GIMP_COLOR_PICK_MODE_FOREGROUND:
modifier = GIMP_CURSOR_MODIFIER_NONE; modifier = GIMP_CURSOR_MODIFIER_FOREGROUND;
break; break;
case GIMP_COLOR_PICK_MODE_FOREGROUND: case GIMP_COLOR_PICK_MODE_BACKGROUND:
modifier = GIMP_CURSOR_MODIFIER_FOREGROUND; modifier = GIMP_CURSOR_MODIFIER_BACKGROUND;
break; break;
case GIMP_COLOR_PICK_MODE_BACKGROUND: case GIMP_COLOR_PICK_MODE_PALETTE:
modifier = GIMP_CURSOR_MODIFIER_BACKGROUND; modifier = GIMP_CURSOR_MODIFIER_PLUS;
break; break;
case GIMP_COLOR_PICK_MODE_PALETTE: }
modifier = GIMP_CURSOR_MODIFIER_PLUS;
break;
} }
gimp_tool_set_cursor (tool, display, gimp_tool_set_cursor (tool, display,
cursor, GIMP_TOOL_CURSOR_COLOR_PICKER, GIMP_CURSOR_COLOR_PICKER,
GIMP_TOOL_CURSOR_COLOR_PICKER,
modifier); modifier);
} }
......
...@@ -102,6 +102,8 @@ gimp_flip_tool_init (GimpFlipTool *flip_tool) ...@@ -102,6 +102,8 @@ gimp_flip_tool_init (GimpFlipTool *flip_tool)
GimpTransformTool *transform_tool = GIMP_TRANSFORM_TOOL (flip_tool); GimpTransformTool *transform_tool = GIMP_TRANSFORM_TOOL (flip_tool);
gimp_tool_control_set_snap_to (tool->control, FALSE); gimp_tool_control_set_snap_to (tool->control, FALSE);
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE);
gimp_tool_control_set_toggle_cursor (tool->control, GIMP_CURSOR_MOUSE);
gimp_tool_control_set_tool_cursor (tool->control, gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_FLIP_HORIZONTAL); GIMP_TOOL_CURSOR_FLIP_HORIZONTAL);
gimp_tool_control_set_toggle_tool_cursor (tool->control, gimp_tool_control_set_toggle_tool_cursor (tool->control,
...@@ -147,8 +149,8 @@ gimp_flip_tool_cursor_update (GimpTool *tool, ...@@ -147,8 +149,8 @@ gimp_flip_tool_cursor_update (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *display) GimpDisplay *display)
{ {
GimpFlipOptions *options; GimpFlipOptions *options;
gboolean bad_cursor = TRUE; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_BAD;
options = GIMP_FLIP_OPTIONS (tool->tool_info->tool_options); options = GIMP_FLIP_OPTIONS (tool->tool_info->tool_options);
...@@ -161,23 +163,16 @@ gimp_flip_tool_cursor_update (GimpTool *tool, ...@@ -161,23 +163,16 @@ gimp_flip_tool_cursor_update (GimpTool *tool,
gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection), gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection),
coords->x, coords->y)) coords->x, coords->y))
{ {
bad_cursor = FALSE; modifier = GIMP_CURSOR_MODIFIER_NONE;
} }
} }
if (bad_cursor) gimp_tool_control_set_cursor_modifier (tool->control, modifier);
{ gimp_tool_control_set_toggle_cursor_modifier (tool->control, modifier);
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_BAD);
gimp_tool_control_set_toggle_cursor (tool->control, GIMP_CURSOR_BAD);
}
else
{
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE);
gimp_tool_control_set_toggle_cursor (tool->control, GIMP_CURSOR_MOUSE);
}
gimp_tool_control_set_toggled (tool->control, gimp_tool_control_set_toggled (tool->control,
options->flip_type == GIMP_ORIENTATION_VERTICAL); options->flip_type ==
GIMP_ORIENTATION_VERTICAL);
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
} }
......
...@@ -979,29 +979,35 @@ gimp_iscissors_tool_cursor_update (GimpTool *tool, ...@@ -979,29 +979,35 @@ gimp_iscissors_tool_cursor_update (GimpTool *tool,
GimpDisplay *display) GimpDisplay *display)
{ {
GimpIscissorsTool *iscissors = GIMP_ISCISSORS_TOOL (tool); GimpIscissorsTool *iscissors = GIMP_ISCISSORS_TOOL (tool);
GimpCursorType cursor = GIMP_CURSOR_MOUSE;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
switch (iscissors->op) switch (iscissors->op)
{ {
case ISCISSORS_OP_SELECT: case ISCISSORS_OP_SELECT:
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords,
state, display);
return; return;
case ISCISSORS_OP_MOVE_POINT: case ISCISSORS_OP_MOVE_POINT:
modifier = GIMP_CURSOR_MODIFIER_MOVE; modifier = GIMP_CURSOR_MODIFIER_MOVE;
break; break;
case ISCISSORS_OP_ADD_POINT: case ISCISSORS_OP_ADD_POINT:
modifier = GIMP_CURSOR_MODIFIER_PLUS; modifier = GIMP_CURSOR_MODIFIER_PLUS;
break; break;
case ISCISSORS_OP_IMPOSSIBLE: case ISCISSORS_OP_IMPOSSIBLE:
cursor = GIMP_CURSOR_BAD; modifier = GIMP_CURSOR_MODIFIER_BAD;
break; break;
default: default:
break; break;
} }
gimp_tool_set_cursor (tool, display, gimp_tool_set_cursor (tool, display,
cursor, GIMP_TOOL_CURSOR_ISCISSORS, modifier); GIMP_CURSOR_MOUSE,
GIMP_TOOL_CURSOR_ISCISSORS,
modifier);
} }
......
...@@ -648,7 +648,7 @@ gimp_move_tool_cursor_update (GimpTool *tool, ...@@ -648,7 +648,7 @@ gimp_move_tool_cursor_update (GimpTool *tool,
GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell); GimpDisplayShell *shell = GIMP_DISPLAY_SHELL (display->shell);
GimpMoveOptions *options = GIMP_MOVE_OPTIONS (tool->tool_info->tool_options); GimpMoveOptions *options = GIMP_MOVE_OPTIONS (tool->tool_info->tool_options);
GimpCursorType cursor = GIMP_CURSOR_BAD; GimpCursorType cursor = GIMP_CURSOR_MOUSE;
GimpToolCursorType tool_cursor = GIMP_TOOL_CURSOR_MOVE; GimpToolCursorType tool_cursor = GIMP_TOOL_CURSOR_MOVE;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE; GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
...@@ -659,8 +659,8 @@ gimp_move_tool_cursor_update (GimpTool *tool, ...@@ -659,8 +659,8 @@ gimp_move_tool_cursor_update (GimpTool *tool,
if (options->move_current) if (options->move_current)
{ {
if (gimp_image_get_active_vectors (display->image)) if (! gimp_image_get_active_vectors (display->image))
cursor = GIMP_CURSOR_MOUSE; modifier = GIMP_CURSOR_MODIFIER_BAD;
} }
else else
{ {
...@@ -668,9 +668,12 @@ gimp_move_tool_cursor_update (GimpTool *tool, ...@@ -668,9 +668,12 @@ gimp_move_tool_cursor_update (GimpTool *tool,
coords, 7, 7, coords, 7, 7,
NULL, NULL, NULL, NULL, NULL, NULL)) NULL, NULL, NULL, NULL, NULL, NULL))
{ {
cursor = GIMP_CURSOR_MOUSE;
tool_cursor = GIMP_TOOL_CURSOR_HAND; tool_cursor = GIMP_TOOL_CURSOR_HAND;
} }
else
{
modifier = GIMP_CURSOR_MODIFIER_BAD;
}
} }
} }
else if (options->move_type == GIMP_TRANSFORM_TYPE_SELECTION) else if (options->move_type == GIMP_TRANSFORM_TYPE_SELECTION)
...@@ -678,13 +681,13 @@ gimp_move_tool_cursor_update (GimpTool *tool, ...@@ -678,13 +681,13 @@ gimp_move_tool_cursor_update (GimpTool *tool,
tool_cursor = GIMP_TOOL_CURSOR_RECT_SELECT; tool_cursor = GIMP_TOOL_CURSOR_RECT_SELECT;
modifier = GIMP_CURSOR_MODIFIER_MOVE; modifier = GIMP_CURSOR_MODIFIER_MOVE;
if (! gimp_channel_is_empty (gimp_image_get_mask (display->image))) if (gimp_channel_is_empty (gimp_image_get_mask (display->image)))
cursor = GIMP_CURSOR_MOUSE; modifier = GIMP_CURSOR_MODIFIER_BAD;
} }
else if (options->move_current) else if (options->move_current)
{ {
if (gimp_image_active_drawable (display->image)) if (! gimp_image_active_drawable (display->image))
cursor = GIMP_CURSOR_MOUSE; modifier = GIMP_CURSOR_MODIFIER_BAD;
} }
else else
{ {
...@@ -700,7 +703,6 @@ gimp_move_tool_cursor_update (GimpTool *tool, ...@@ -700,7 +703,6 @@ gimp_move_tool_cursor_update (GimpTool *tool,
FUNSCALEX (shell, snap_distance), FUNSCALEX (shell, snap_distance),
FUNSCALEY (shell, snap_distance)))) FUNSCALEY (shell, snap_distance))))
{ {
cursor = GIMP_CURSOR_MOUSE;
tool_cursor = GIMP_TOOL_CURSOR_HAND; tool_cursor = GIMP_TOOL_CURSOR_HAND;
modifier = GIMP_CURSOR_MODIFIER_MOVE; modifier = GIMP_CURSOR_MODIFIER_MOVE;
} }
...@@ -711,21 +713,19 @@ gimp_move_tool_cursor_update (GimpTool *tool, ...@@ -711,21 +713,19 @@ gimp_move_tool_cursor_update (GimpTool *tool,
if (gimp_image_floating_sel (display->image) && if (gimp_image_floating_sel (display->image) &&
! gimp_layer_is_floating_sel (layer)) ! gimp_layer_is_floating_sel (layer))
{ {
cursor = GIMP_CURSOR_MOUSE;
tool_cursor = GIMP_TOOL_CURSOR_MOVE; tool_cursor = GIMP_TOOL_CURSOR_MOVE;
modifier = GIMP_CURSOR_MODIFIER_ANCHOR; modifier = GIMP_CURSOR_MODIFIER_ANCHOR;
} }
else if (layer == gimp_image_get_active_layer (display->image)) else if (layer != gimp_image_get_active_layer (display->image))
{
cursor = GIMP_CURSOR_MOUSE;
}
else
{ {
cursor = GIMP_CURSOR_MOUSE;
tool_cursor = GIMP_TOOL_CURSOR_HAND; tool_cursor = GIMP_TOOL_CURSOR_HAND;
modifier = GIMP_CURSOR_MODIFIER_MOVE; modifier = GIMP_CURSOR_MODIFIER_MOVE;
} }
} }
else
{
modifier = GIMP_CURSOR_MODIFIER_BAD;
}
} }
gimp_tool_control_set_cursor (tool->control, cursor); gimp_tool_control_set_cursor (tool->control, cursor);
......
...@@ -209,8 +209,9 @@ gimp_clone_tool_cursor_update (GimpTool *tool, ...@@ -209,8 +209,9 @@ gimp_clone_tool_cursor_update (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *display) GimpDisplay *display)
{ {
GimpCloneOptions *options; GimpCloneOptions *options;
GimpCursorType ctype = GIMP_CURSOR_MOUSE; GimpCursorType cursor = GIMP_CURSOR_MOUSE;
GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_NONE;
options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options); options = GIMP_CLONE_OPTIONS (tool->tool_info->tool_options);
...@@ -224,18 +225,25 @@ gimp_clone_tool_cursor_update (GimpTool *tool, ...@@ -224,18 +225,25 @@ gimp_clone_tool_cursor_update (GimpTool *tool,
if (gimp_channel_is_empty (selection) || if (gimp_channel_is_empty (selection) ||
gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection), gimp_pickable_get_opacity_at (GIMP_PICKABLE (selection),
coords->x, coords->y)) coords->x, coords->y))
ctype = GIMP_CURSOR_MOUSE; {
cursor = GIMP_CURSOR_MOUSE;
}
} }
if (options->clone_type == GIMP_IMAGE_CLONE) if (options->clone_type == GIMP_IMAGE_CLONE)
{ {
if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK) if ((state & (GDK_CONTROL_MASK | GDK_SHIFT_MASK)) == GDK_CONTROL_MASK)
ctype = GIMP_CURSOR_CROSSHAIR_SMALL; {
cursor = GIMP_CURSOR_CROSSHAIR_SMALL;
}
else if (! GIMP_CLONE (GIMP_PAINT_TOOL (tool)->core)->src_drawable) else if (! GIMP_CLONE (GIMP_PAINT_TOOL (tool)->core)->src_drawable)
ctype = GIMP_CURSOR_BAD; {
modifier = GIMP_CURSOR_MODIFIER_BAD;
}
} }
gimp_tool_control_set_cursor (tool->control, ctype); gimp_tool_control_set_cursor (tool->control, cursor);
gimp_tool_control_set_cursor_modifier (tool->control, modifier);
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display); GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
} }
......
...@@ -643,16 +643,15 @@ gimp_transform_tool_cursor_update (GimpTool *tool, ...@@ -643,16 +643,15 @@ gimp_transform_tool_cursor_update (GimpTool *tool,
break; break;
case GIMP_TRANSFORM_TYPE_PATH: case GIMP_TRANSFORM_TYPE_PATH:
if (gimp_image_get_active_vectors (display->image)) if (! gimp_image_get_active_vectors (display->image))
cursor = GIMP_CURSOR_MOUSE; modifier = GIMP_CURSOR_MODIFIER_BAD;
else
cursor = GIMP_CURSOR_BAD;
break; break;
} }
if (tr_tool->use_center && tr_tool->function == TRANSFORM_HANDLE_CENTER) if (tr_tool->use_center && tr_tool->function == TRANSFORM_HANDLE_CENTER)
{ {
modifier = GIMP_CURSOR_MODIFIER_MOVE; if (modifier != GIMP_CURSOR_MODIFIER_BAD)
modifier = GIMP_CURSOR_MODIFIER_MOVE;
} }
gimp_tool_control_set_cursor (tool->control, cursor); gimp_tool_control_set_cursor (tool->control, cursor);
......
...@@ -187,6 +187,7 @@ gimp_vector_tool_init (GimpVectorTool *vector_tool) ...@@ -187,6 +187,7 @@ gimp_vector_tool_init (GimpVectorTool *vector_tool)
gimp_tool_control_set_handle_empty_image (tool->control, TRUE); gimp_tool_control_set_handle_empty_image (tool->control, TRUE);
gimp_tool_control_set_motion_mode (tool->control, gimp_tool_control_set_motion_mode (tool->control,
GIMP_MOTION_MODE_COMPRESS); GIMP_MOTION_MODE_COMPRESS);
gimp_tool_control_set_cursor (tool->control, GIMP_CURSOR_MOUSE);
gimp_tool_control_set_tool_cursor (tool->control,