mirror of
https://github.com/greenshot/greenshot
synced 2025-08-14 02:37:03 -07:00
Allowed the picker to be closed by keyboard, e.g. ESC / Alt+F4 (F10?)
git-svn-id: http://svn.code.sf.net/p/greenshot/code/trunk@1914 7dccd23d-a4a3-4e1f-8c07-b4c1b4018ab4
This commit is contained in:
parent
6f3c928792
commit
fcd993ce27
1 changed files with 9 additions and 3 deletions
|
@ -62,9 +62,15 @@ namespace Greenshot.Destinations {
|
|||
ContextMenuStrip menu = new ContextMenuStrip();
|
||||
menu.Closing += delegate(object source, ToolStripDropDownClosingEventArgs eventArgs) {
|
||||
LOG.DebugFormat("Close reason: {0}", eventArgs.CloseReason);
|
||||
if (eventArgs.CloseReason != ToolStripDropDownCloseReason.ItemClicked && eventArgs.CloseReason != ToolStripDropDownCloseReason.CloseCalled) {
|
||||
eventArgs.Cancel = true;
|
||||
}
|
||||
switch (eventArgs.CloseReason) {
|
||||
case ToolStripDropDownCloseReason.ItemClicked:
|
||||
case ToolStripDropDownCloseReason.CloseCalled:
|
||||
case ToolStripDropDownCloseReason.Keyboard:
|
||||
break;
|
||||
default:
|
||||
eventArgs.Cancel = true;
|
||||
break;
|
||||
}
|
||||
};
|
||||
foreach (IDestination destination in destinations) {
|
||||
// Fix foreach loop variable for the delegate
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue