more progress - player switching working
This commit is contained in:
@@ -151,6 +151,26 @@ func (m *Controller) HaveModal() bool {
|
||||
return m.haveModal
|
||||
}
|
||||
|
||||
func (m *Controller) ShowCastMenu() {
|
||||
devices := m.App.PlaybackManager.RemotePlayers()
|
||||
menu := fyne.NewMenu("")
|
||||
menu.Items = append(menu.Items, fyne.NewMenuItem(lang.L("Local player"), func() {
|
||||
m.App.PlaybackManager.SetRemotePlayer(nil)
|
||||
}))
|
||||
for _, d := range devices {
|
||||
_d := d
|
||||
menu.Items = append(menu.Items, fyne.NewMenuItem(d.Name, func() {
|
||||
m.App.PlaybackManager.SetRemotePlayer(&_d)
|
||||
}))
|
||||
}
|
||||
pop := widget.NewPopUpMenu(menu, m.MainWindow.Canvas())
|
||||
canvasSize := m.MainWindow.Canvas().Size()
|
||||
pop.ShowAtPosition(fyne.NewPos(
|
||||
canvasSize.Width-pop.MinSize().Width-10,
|
||||
canvasSize.Height-pop.MinSize().Height-100,
|
||||
))
|
||||
}
|
||||
|
||||
func (m *Controller) ShowPopUpPlayQueue() {
|
||||
m.popUpQueueMutex.Lock()
|
||||
if m.popUpQueue == nil {
|
||||
|
||||
Reference in New Issue
Block a user