diff --git a/v3/pkg/application/menuitem_windows.go b/v3/pkg/application/menuitem_windows.go index 31cf0f248..825b2f05c 100644 --- a/v3/pkg/application/menuitem_windows.go +++ b/v3/pkg/application/menuitem_windows.go @@ -26,7 +26,7 @@ type windowsMenuItem struct { func (m *windowsMenuItem) setHidden(hidden bool) { if hidden && !m.hidden { m.hidden = true - // iterate the parent items and find the menu item before us + // iterate the parent items and find the menu item after us for i, item := range m.parent.items { if item == m.menuItem { if i < len(m.parent.items)-1 { @@ -37,14 +37,11 @@ func (m *windowsMenuItem) setHidden(hidden bool) { break } } - // Get the position of this menu item in the parent menu - // m.pos = w32.GetMenuItemPosition(m.hMenu, uint32(m.id)) // Remove from parent menu w32.RemoveMenu(m.hMenu, m.id, w32.MF_BYCOMMAND) } else if !hidden && m.hidden { m.hidden = false - // Add to parent menu - // Get the position of the item before us + // Add to parent menu before the "itemAfter" var pos int if m.itemAfter != nil { for i, item := range m.parent.items {