app: add proper cursors that show what will happen

This commit is contained in:
Michael Natterer 2010-11-06 00:03:38 +01:00
parent c791ed0dca
commit 31aa09a11f
1 changed files with 15 additions and 20 deletions

View File

@ -175,6 +175,8 @@ gimp_cage_tool_init (GimpCageTool *self)
self->image_map = NULL; self->image_map = NULL;
gimp_tool_control_set_wants_click (tool->control, TRUE); gimp_tool_control_set_wants_click (tool->control, TRUE);
gimp_tool_control_set_tool_cursor (tool->control,
GIMP_TOOL_CURSOR_PERSPECTIVE);
} }
static void static void
@ -455,32 +457,25 @@ gimp_cage_tool_cursor_update (GimpTool *tool,
GdkModifierType state, GdkModifierType state,
GimpDisplay *display) GimpDisplay *display)
{ {
GimpCageTool *ct = GIMP_CAGE_TOOL (tool); GimpCageTool *ct = GIMP_CAGE_TOOL (tool);
GimpCageOptions *options = GIMP_CAGE_TOOL_GET_OPTIONS (ct); GimpCursorModifier modifier = GIMP_CURSOR_MODIFIER_PLUS;
if (tool->display == NULL) if (tool->display)
{ {
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, if (ct->hovering_handle != -1)
display);
}
else
{
GimpCursorModifier modifier;
if (options->cage_mode == GIMP_CAGE_MODE_CAGE_CHANGE)
{
modifier = GIMP_CURSOR_MODIFIER_ANCHOR;
}
else
{ {
modifier = GIMP_CURSOR_MODIFIER_MOVE; modifier = GIMP_CURSOR_MODIFIER_MOVE;
} }
else
gimp_tool_set_cursor (tool, display, {
gimp_tool_control_get_cursor (tool->control), if (ct->cage_complete)
gimp_tool_control_get_tool_cursor (tool->control), modifier = GIMP_CURSOR_MODIFIER_BAD;
modifier); }
} }
gimp_tool_control_set_cursor_modifier (tool->control, modifier);
GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
} }
static void static void