From 493f2801c263720e9bcb95824bf0cf4a4299e1a5 Mon Sep 17 00:00:00 2001 From: Phap Dieu Duong Date: Wed, 18 Apr 2018 21:18:26 +0800 Subject: [PATCH] fixed: cursor changed to drag mode when pressing hotkey - stoped the checkMenuShortcut for loop --- Source/ImageGlass/frmMain.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Source/ImageGlass/frmMain.cs b/Source/ImageGlass/frmMain.cs index 968407ea9..3f9e6abdb 100644 --- a/Source/ImageGlass/frmMain.cs +++ b/Source/ImageGlass/frmMain.cs @@ -507,6 +507,8 @@ private void NextPic(int step, bool isKeepZoomRatio, bool isSkippingCache = fals LocalSetting.ImageModifiedPath = ""; } + _isDraggingImage = false; + //Select thumbnail item SelectCurrentThumbnail(); @@ -569,7 +571,7 @@ private void frmMain_KeyDown(object sender, KeyEventArgs e) //this.Text = e.KeyValue.ToString(); #region Register MAIN MENU shortcuts - void checkMenuShortcut(ToolStripMenuItem mnu) + bool checkMenuShortcut(ToolStripMenuItem mnu) { Keys pressed = e.KeyCode; if (e.Control) pressed = pressed | Keys.Control; @@ -579,17 +581,23 @@ void checkMenuShortcut(ToolStripMenuItem mnu) if (mnu.ShortcutKeys == pressed) { mnu.PerformClick(); + return true; } foreach (ToolStripMenuItem child in mnu.DropDownItems.OfType()) { checkMenuShortcut(child); } + + return false; } //register context menu shortcuts foreach (ToolStripMenuItem item in mnuMain.Items.OfType()) { - checkMenuShortcut(item); + if (checkMenuShortcut(item)) + { + return; + } } #endregion