From 3ffb92d6e3f14efa5c1d73bd566b42b7b2bf7818 Mon Sep 17 00:00:00 2001 From: Lea Anthony Date: Wed, 12 Oct 2022 20:46:34 +1100 Subject: [PATCH] Fix radio group bug when group is last in menu --- v2/internal/platform/systray/menu.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/v2/internal/platform/systray/menu.go b/v2/internal/platform/systray/menu.go index e41cef3f7..9fbc9ef9d 100644 --- a/v2/internal/platform/systray/menu.go +++ b/v2/internal/platform/systray/menu.go @@ -107,6 +107,13 @@ func (p *PopupMenu) buildMenu(parentMenu win32.PopupMenu, inputMenu *menu.Menu, return errors.New("AppendMenu failed") } } + if len(currentRadioGroup) > 0 { + for _, radioMember := range currentRadioGroup { + currentRadioGroup := currentRadioGroup + p.radioGroups[radioMember.MenuItem] = append(p.radioGroups[radioMember.MenuItem], ¤tRadioGroup) + } + currentRadioGroup = RadioGroup{} + } return nil }