mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 13:10:00 -07:00
#677 destinations with subdestinations can now be clicked to invoke the "main" subdestination
This commit is contained in:
parent
8c4eef8e2b
commit
f6f7e3f935
1 changed files with 7 additions and 0 deletions
|
@ -199,6 +199,10 @@ namespace GreenshotPlugin.Core {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
menu.MouseEnter += delegate(object source, EventArgs eventArgs) {
|
||||||
|
// in case the menu has been unfocused, focus again so that dropdown menus will still open on mouseenter
|
||||||
|
if(!menu.ContainsFocus) menu.Focus();
|
||||||
|
};
|
||||||
foreach (IDestination destination in destinations) {
|
foreach (IDestination destination in destinations) {
|
||||||
// Fix foreach loop variable for the delegate
|
// Fix foreach loop variable for the delegate
|
||||||
ToolStripMenuItem item = destination.GetMenuItem(addDynamics, menu,
|
ToolStripMenuItem item = destination.GetMenuItem(addDynamics, menu,
|
||||||
|
@ -324,6 +328,9 @@ namespace GreenshotPlugin.Core {
|
||||||
AddTagEvents(destinationMenuItem, menu, Description);
|
AddTagEvents(destinationMenuItem, menu, Description);
|
||||||
|
|
||||||
basisMenuItem.DropDownItems.Add(destinationMenuItem);
|
basisMenuItem.DropDownItems.Add(destinationMenuItem);
|
||||||
|
// invoke the "main" subdestination when clicking its parent
|
||||||
|
basisMenuItem.Click -= destinationClickHandler;
|
||||||
|
basisMenuItem.Click += destinationClickHandler;
|
||||||
}
|
}
|
||||||
if (useDynamicsOnly && subDestinations.Count == 1) {
|
if (useDynamicsOnly && subDestinations.Count == 1) {
|
||||||
basisMenuItem.Tag = subDestinations[0];
|
basisMenuItem.Tag = subDestinations[0];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue