[gimp] app: change the cursor when the mouse hovers the split view guide



commit 3e833b9a5c51447794da048db13c0992077ee5b3
Author: Michael Natterer <mitch gimp org>
Date:   Tue Apr 5 20:26:05 2016 +0200

    app: change the cursor when the mouse hovers the split view guide

 app/tools/gimpimagemaptool.c |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/app/tools/gimpimagemaptool.c b/app/tools/gimpimagemaptool.c
index 3469066..a41c9a0 100644
--- a/app/tools/gimpimagemaptool.c
+++ b/app/tools/gimpimagemaptool.c
@@ -646,11 +646,32 @@ gimp_image_map_tool_cursor_update (GimpTool         *tool,
                                    GdkModifierType   state,
                                    GimpDisplay      *display)
 {
+  GimpImageMapTool *im_tool = GIMP_IMAGE_MAP_TOOL (tool);
+
   GIMP_TOOL_CLASS (parent_class)->cursor_update (tool, coords, state,
                                                  display);
 
   if (! gimp_color_tool_is_enabled (GIMP_COLOR_TOOL (tool)))
     {
+      GimpDisplayShell *shell = gimp_display_get_shell (display);
+
+      if (im_tool->image_map     &&
+          im_tool->percent_guide &&
+          gimp_display_shell_get_show_guides (shell))
+        {
+          const gint snap_distance = display->config->snap_distance;
+          gint       position;
+
+          position = gimp_guide_get_position (im_tool->percent_guide);
+
+          if (fabs (coords->x - position) <= FUNSCALEX (shell, snap_distance))
+            {
+              gimp_tool_set_cursor (tool, display,
+                                    GIMP_CURSOR_MOUSE,
+                                    GIMP_TOOL_CURSOR_HAND,
+                                    GIMP_CURSOR_MODIFIER_MOVE);
+            }
+        }
     }
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]