[gimp/soc-2010-cage-2] app: add proper cursors that show what will	happen
- From: Michael Muré <mmure src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gimp/soc-2010-cage-2] app: add proper cursors that show what will	happen
- Date: Thu, 30 Dec 2010 18:07:33 +0000 (UTC)
commit 4b291f027d29d204a49c5ddeb03913dc6cb5bca6
Author: Michael Natterer <mitch gimp org>
Date:   Sat Nov 6 00:03:38 2010 +0100
    app: add proper cursors that show what will happen
 app/tools/gimpcagetool.c |   31 +++++++++++++------------------
 1 files changed, 13 insertions(+), 18 deletions(-)
---
diff --git a/app/tools/gimpcagetool.c b/app/tools/gimpcagetool.c
index 75e9a35..d831afb 100644
--- a/app/tools/gimpcagetool.c
+++ b/app/tools/gimpcagetool.c
@@ -175,6 +175,8 @@ gimp_cage_tool_init (GimpCageTool *self)
   self->image_map       = NULL;
 
   gimp_tool_control_set_wants_click (tool->control, TRUE);
+  gimp_tool_control_set_tool_cursor (tool->control,
+                                     GIMP_TOOL_CURSOR_PERSPECTIVE);
 }
 
 static void
@@ -455,32 +457,25 @@ gimp_cage_tool_cursor_update (GimpTool         *tool,
                               GdkModifierType   state,
                               GimpDisplay      *display)
 {
-  GimpCageTool    *ct      = GIMP_CAGE_TOOL (tool);
-  GimpCageOptions *options = GIMP_CAGE_TOOL_GET_OPTIONS (ct);
+  GimpCageTool       *ct       = GIMP_CAGE_TOOL (tool);
+  GimpCursorModifier  modifier = GIMP_CURSOR_MODIFIER_PLUS;
 
-  if (tool->display == NULL)
-    {
-      GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state,
-                                                     display);
-    }
-  else
+  if (tool->display)
     {
-      GimpCursorModifier modifier;
-
-      if (options->cage_mode == GIMP_CAGE_MODE_CAGE_CHANGE)
+      if (ct->hovering_handle != -1)
         {
-          modifier = GIMP_CURSOR_MODIFIER_ANCHOR;
+          modifier = GIMP_CURSOR_MODIFIER_MOVE;
         }
       else
         {
-          modifier = GIMP_CURSOR_MODIFIER_MOVE;
+          if (ct->cage_complete)
+            modifier = GIMP_CURSOR_MODIFIER_BAD;
         }
-
-      gimp_tool_set_cursor (tool, display,
-                            gimp_tool_control_get_cursor (tool->control),
-                            gimp_tool_control_get_tool_cursor (tool->control),
-                            modifier);
     }
+
+  gimp_tool_control_set_cursor_modifier (tool->control, modifier);
+
+  GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state, display);
 }
 
 static void
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]