From 8e244b59822d6a1c42893c655dc4115c787eeb8c Mon Sep 17 00:00:00 2001 From: Jaex Date: Thu, 2 Apr 2020 17:32:28 +0300 Subject: [PATCH] Added hover and grab cursor support to all image editor controls --- ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs index 27ece43f0..b1b2e4210 100644 --- a/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs +++ b/ShareX.ScreenCaptureLib/Shapes/ShapeManager.cs @@ -358,6 +358,24 @@ public ShapeManager(RegionCaptureForm form) { scrollbarManager = new ScrollbarManager(form, this); } + + foreach (ImageEditorControl control in DrawableObjects) + { + control.MouseDown += (sender, e) => Form.SetHandCursor(true); + control.MouseUp += (sender, e) => + { + if (control.IsCursorHover) + { + Form.SetHandCursor(false); + } + else + { + Form.SetDefaultCursor(); + } + }; + control.MouseEnter += () => Form.SetHandCursor(false); + control.MouseLeave += () => Form.SetDefaultCursor(); + } } private void form_Shown(object sender, EventArgs e)