diff --git a/README.md b/README.md index bb84615..1e7c8c9 100644 --- a/README.md +++ b/README.md @@ -135,6 +135,7 @@ These controls are accessible from any view: - `d`/`Delete`: Remove currently selected song from the queue - `D`: Remove all songs from queue - `y`: Toggle star on song +- `i`: Toggle song info panel - `k`: Move song up in queue - `j`: Move song down in queue - `s`: Save the queue as a playlist diff --git a/help_text.go b/help_text.go index c958127..763a7f7 100644 --- a/help_text.go +++ b/help_text.go @@ -33,6 +33,7 @@ const helpPageQueue = ` d/DEL remove currently selected song from the queue D remove all songs from queue y toggle star on song +i toggle song info panel k move selected song up in queue j move selected song down in queue s save queue as a playlist diff --git a/page_queue.go b/page_queue.go index 500dcea..8447df7 100644 --- a/page_queue.go +++ b/page_queue.go @@ -45,6 +45,7 @@ type QueuePage struct { queueList *tview.Table queueData queueData + infoFlex *tview.Flex songInfo *tview.TextView coverArt *tview.Image @@ -133,7 +134,12 @@ func (ui *Ui) createQueuePage() *QueuePage { _ = ui.player.Pause() } }() - + case 'i': + if queuePage.Root.GetItemCount() == 2 { + queuePage.Root.RemoveItem(queuePage.infoFlex) + } else { + queuePage.Root.AddItem(queuePage.infoFlex, 0, 1, false) + } default: return event } @@ -154,16 +160,16 @@ func (ui *Ui) createQueuePage() *QueuePage { queuePage.coverArt = tview.NewImage() queuePage.coverArt.SetImage(STMPS_LOGO) - infoFlex := tview.NewFlex().SetDirection(tview.FlexRow). + queuePage.infoFlex = tview.NewFlex().SetDirection(tview.FlexRow). AddItem(queuePage.songInfo, 0, 1, false). AddItem(queuePage.coverArt, 0, 1, false) - infoFlex.SetBorder(true) - infoFlex.SetTitle(" song info ") + queuePage.infoFlex.SetBorder(true) + queuePage.infoFlex.SetTitle(" song info ") // flex wrapper queuePage.Root = tview.NewFlex().SetDirection(tview.FlexColumn). AddItem(queuePage.queueList, 0, 2, true). - AddItem(infoFlex, 0, 1, false) + AddItem(queuePage.infoFlex, 0, 1, false) // private data queuePage.queueData = queueData{