Skip to content

Commit

Permalink
fixed: cursor changed to drag mode when pressing hotkey
Browse files Browse the repository at this point in the history
- stoped the checkMenuShortcut for loop
  • Loading branch information
d2phap committed Apr 18, 2018
1 parent c96d454 commit 493f280
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Source/ImageGlass/frmMain.cs
Expand Up @@ -507,6 +507,8 @@ private void NextPic(int step, bool isKeepZoomRatio, bool isSkippingCache = fals
LocalSetting.ImageModifiedPath = "";
}

_isDraggingImage = false;

//Select thumbnail item
SelectCurrentThumbnail();

Expand Down Expand Up @@ -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;
Expand All @@ -579,17 +581,23 @@ void checkMenuShortcut(ToolStripMenuItem mnu)
if (mnu.ShortcutKeys == pressed)
{
mnu.PerformClick();
return true;
}
foreach (ToolStripMenuItem child in mnu.DropDownItems.OfType<ToolStripMenuItem>())
{
checkMenuShortcut(child);
}

return false;
}

//register context menu shortcuts
foreach (ToolStripMenuItem item in mnuMain.Items.OfType<ToolStripMenuItem>())
{
checkMenuShortcut(item);
if (checkMenuShortcut(item))
{
return;
}
}
#endregion

Expand Down

0 comments on commit 493f280

Please sign in to comment.