Skip to content

Commit

Permalink
Open bar menu as an overlay so it is above windows
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed May 26, 2024
1 parent e2150fa commit d32b33d
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions internal/ui/baricon.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ func removeFromBar(icon fynedesk.AppData) {
}

// TappedSecondary means barIcon has been clicked by a secondary binding
func (bi *barIcon) TappedSecondary(*fyne.PointEvent) {
func (bi *barIcon) TappedSecondary(ev *fyne.PointEvent) {
app := bi.appData
if app == nil && bi.windowData != nil {
app = bi.windowData.findApp()
Expand All @@ -136,10 +136,8 @@ func (bi *barIcon) TappedSecondary(*fyne.PointEvent) {
addRemove.Label = "Pin " + app.Name()
}

c := fyne.CurrentApp().Driver().CanvasForObject(bi)
pos := fyne.CurrentApp().Driver().AbsolutePositionForObject(bi)
menu = widget.NewPopUpMenu(fyne.NewMenu("", []*fyne.MenuItem{addRemove}...), c)
menu.ShowAtPosition(pos)
items := []*fyne.MenuItem{addRemove}
fynedesk.Instance().ShowMenuAt(fyne.NewMenu("", items...), ev.AbsolutePosition)
}

// CreateRenderer is a private method to fyne which links this widget to its renderer
Expand Down

0 comments on commit d32b33d

Please sign in to comment.