tracklist column visibility menu can be dismissed with escape key

This commit is contained in:
Drew Weymouth
2023-03-03 20:59:59 -08:00
parent b2c16bf331
commit 321fdf0621
3 changed files with 15 additions and 1 deletions
+5 -1
View File
@@ -20,7 +20,8 @@ type ListColumn struct {
type ListHeader struct {
widget.BaseWidget
OnColumnVisibilityChanged func(int, bool)
OnColumnVisibilityChanged func(int, bool)
OnColumnVisibilityMenuShown func(*widget.PopUp)
columns []ListColumn
columnVisible []bool
@@ -84,6 +85,9 @@ func (l *ListHeader) TappedSecondary(e *fyne.PointEvent) {
}
pop := widget.NewPopUp(l.popUpMenu, fyne.CurrentApp().Driver().CanvasForObject(l))
pop.ShowAtPosition(e.AbsolutePosition)
if l.OnColumnVisibilityMenuShown != nil {
l.OnColumnVisibilityMenuShown(pop)
}
}
func (l *ListHeader) setupPopUpMenu() {