[gimp] app: show the "relative edit" cursor on motion with Shift pushed.



commit 670bc35eb98e90cb39984b1bede6e478a7476a0b
Author: Jehan <jehan girinstud io>
Date:   Wed Dec 16 18:43:14 2020 +0100

    app: show the "relative edit" cursor on motion with Shift pushed.
    
    If you hover over the GimpSpinScale while clicking Shift, we want to be
    able to advertize the fact that it will produce a different action than
    the simple click. It makes the widget behavioral rules actually
    discoverable.

 app/widgets/gimpspinscale.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/app/widgets/gimpspinscale.c b/app/widgets/gimpspinscale.c
index 1bc4ffb227..22d070b976 100644
--- a/app/widgets/gimpspinscale.c
+++ b/app/widgets/gimpspinscale.c
@@ -598,6 +598,13 @@ gimp_spin_scale_get_target (GtkWidget *widget,
               return TARGET_NUMBER;
             }
         }
+      else
+        {
+          GdkEventMotion *event_motion = (GdkEventMotion *) event;
+
+          if (event_motion->state & GDK_SHIFT_MASK)
+            return TARGET_RELATIVE;
+        }
 
       /* For motion events or main button clicks, the target depends on
        * the position.


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