mirror of
https://github.com/ShareX/ShareX.git
synced 2024-06-30 20:20:34 +12:00
Right click will close code menu
This commit is contained in:
parent
bac503c1b9
commit
fa9e751dd7
|
@ -68,10 +68,17 @@ public static ContextMenuStrip Create(TextBoxBase tb, CodeMenuItem[] items)
|
|||
foreach (CodeMenuItem item in items)
|
||||
{
|
||||
ToolStripMenuItem tsmi = new ToolStripMenuItem { Text = $"{item.Name} - {item.Description}", Tag = item.Name };
|
||||
tsmi.Click += (sender, e) =>
|
||||
tsmi.MouseUp += (sender, e) =>
|
||||
{
|
||||
string text = ((ToolStripMenuItem)sender).Tag.ToString();
|
||||
tb.AppendTextToSelection(text);
|
||||
if (e.Button == MouseButtons.Left)
|
||||
{
|
||||
string text = ((ToolStripMenuItem)sender).Tag.ToString();
|
||||
tb.AppendTextToSelection(text);
|
||||
}
|
||||
else
|
||||
{
|
||||
cms.Close();
|
||||
}
|
||||
};
|
||||
|
||||
if (string.IsNullOrWhiteSpace(item.Category))
|
||||
|
|
Loading…
Reference in a new issue