mirror of
https://github.com/greenshot/greenshot
synced 2025-08-19 04:59:30 -07:00
Changed dynamic destination handling, children are only created for the dynamic destinations and not the "parent". e.g. there is an outlook entry, which has children for all the open emails, but not for outlook itself. As this was already in the menu on the main level, there is no need to repeat this.
This commit is contained in:
parent
8588fbd510
commit
f1642f3014
2 changed files with 5 additions and 20 deletions
|
@ -19,6 +19,8 @@ Bugs resolved:
|
||||||
* Bug #1610: Image editor: 'Obfuscate' and 'Highlight' and more, now should rotate / resize correctly.
|
* Bug #1610: Image editor: 'Obfuscate' and 'Highlight' and more, now should rotate / resize correctly.
|
||||||
* Bug #1619: Image editor: Autocrop now also considers the elements.
|
* Bug #1619: Image editor: Autocrop now also considers the elements.
|
||||||
|
|
||||||
|
Changes:
|
||||||
|
* We cleaned up the dynamic destination context-menu: if an entry (e.g export to the editor) has child items (export to open editors) the parent is still selectable, we also no longer repeat the parent in the children.
|
||||||
|
|
||||||
1.1.9.13-g01ce82d Windows 8.1 & Box bug-fix Release
|
1.1.9.13-g01ce82d Windows 8.1 & Box bug-fix Release
|
||||||
|
|
||||||
|
|
|
@ -307,6 +307,9 @@ namespace GreenshotPlugin.Core {
|
||||||
basisMenuItem.Tag = this;
|
basisMenuItem.Tag = this;
|
||||||
basisMenuItem.Text = Description;
|
basisMenuItem.Text = Description;
|
||||||
AddTagEvents(basisMenuItem, menu, Description);
|
AddTagEvents(basisMenuItem, menu, Description);
|
||||||
|
basisMenuItem.Click -= destinationClickHandler;
|
||||||
|
basisMenuItem.Click += destinationClickHandler;
|
||||||
|
|
||||||
if (isDynamic && addDynamics) {
|
if (isDynamic && addDynamics) {
|
||||||
basisMenuItem.DropDownOpening += delegate(object source, EventArgs eventArgs) {
|
basisMenuItem.DropDownOpening += delegate(object source, EventArgs eventArgs) {
|
||||||
if (basisMenuItem.DropDownItems.Count == 0) {
|
if (basisMenuItem.DropDownItems.Count == 0) {
|
||||||
|
@ -322,18 +325,6 @@ namespace GreenshotPlugin.Core {
|
||||||
|
|
||||||
ToolStripMenuItem destinationMenuItem = null;
|
ToolStripMenuItem destinationMenuItem = null;
|
||||||
|
|
||||||
if (!useDynamicsOnly) {
|
|
||||||
destinationMenuItem = new ToolStripMenuItem(Description);
|
|
||||||
destinationMenuItem.Tag = this;
|
|
||||||
destinationMenuItem.Image = DisplayIcon;
|
|
||||||
destinationMenuItem.Click += destinationClickHandler;
|
|
||||||
AddTagEvents(destinationMenuItem, menu, Description);
|
|
||||||
|
|
||||||
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];
|
||||||
basisMenuItem.Text = subDestinations[0].Description;
|
basisMenuItem.Text = subDestinations[0].Description;
|
||||||
|
@ -349,17 +340,9 @@ namespace GreenshotPlugin.Core {
|
||||||
basisMenuItem.DropDownItems.Add(destinationMenuItem);
|
basisMenuItem.DropDownItems.Add(destinationMenuItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// Setting base "click" only if there are no sub-destinations
|
|
||||||
|
|
||||||
// Make sure any previous handler is removed, otherwise it would be added multiple times!
|
|
||||||
basisMenuItem.Click -= destinationClickHandler;
|
|
||||||
basisMenuItem.Click += destinationClickHandler;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} else {
|
|
||||||
basisMenuItem.Click += destinationClickHandler;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return basisMenuItem;
|
return basisMenuItem;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue