mirror of
https://github.com/aditya-K2/gspt.git
synced 2026-01-09 13:58:05 -05:00
Add GenreStyle
This commit is contained in:
25
ui/app.go
25
ui/app.go
@@ -21,6 +21,7 @@ var (
|
||||
AlbumStyle = tcell.StyleDefault.Foreground(tcell.ColorGreen).Background(tcell.ColorBlack)
|
||||
ArtistStyle = tcell.StyleDefault.Foreground(tcell.ColorPink).Background(tcell.ColorBlack)
|
||||
TimeStyle = tcell.StyleDefault.Foreground(tcell.ColorOrange).Background(tcell.ColorBlack)
|
||||
GenreStyle = tcell.StyleDefault.Foreground(tcell.ColorPaleTurquoise).Background(tcell.ColorBlack)
|
||||
PlaylistNavStyle = tcell.StyleDefault.Foreground(tcell.ColorCoral).Background(tcell.ColorBlack)
|
||||
NavStyle = tcell.StyleDefault.Foreground(tcell.ColorPapayaWhip).Background(tcell.ColorBlack)
|
||||
ContextMenuStyle = tcell.StyleDefault.Foreground(tcell.ColorPink).Background(tcell.ColorDefault).Bold(true)
|
||||
@@ -107,9 +108,21 @@ func NewApplication() *Application {
|
||||
tcell.KeyEnter: "openEntry",
|
||||
tcell.KeyCtrlP: "playEntry",
|
||||
})
|
||||
recentlyPlayedView.MapActions(map[tcell.Key]string{
|
||||
|
||||
recentlyPlayedView.SetActions(map[string]*Action{
|
||||
"selectEntry": NewAction(recentlyPlayedView.SelectEntry, pBar),
|
||||
})
|
||||
albumsView.SetActions(map[string]*Action{
|
||||
"openAlbum": NewAction(func(e *tcell.EventKey) *tcell.EventKey {
|
||||
albumsView.OpenAlbum()
|
||||
return nil
|
||||
}, nil),
|
||||
})
|
||||
|
||||
recentlyPlayedView.SetMappings(map[tcell.Key]string{
|
||||
tcell.KeyEnter: "selectEntry",
|
||||
})
|
||||
|
||||
searchNavFlex := tview.NewFlex().SetDirection(tview.FlexRow).
|
||||
AddItem(NavMenu.Table, 6, 3, false).
|
||||
AddItem(playlistNav.Table, 0, 6, false).
|
||||
@@ -185,6 +198,16 @@ func NewApplication() *Application {
|
||||
}
|
||||
}()
|
||||
|
||||
topTracksView.SetMappings(map[tcell.Key]string{
|
||||
tcell.KeyEnter: "openEntry",
|
||||
tcell.KeyCtrlP: "playEntry",
|
||||
})
|
||||
|
||||
topTracksView.SetActions(map[string]*Action{
|
||||
"openEntry": NewAction(func(e *tcell.EventKey) *tcell.EventKey { topTracksView.OpenSelectEntry(); return nil }, pBar),
|
||||
"playEntry": NewAction(func(e *tcell.EventKey) *tcell.EventKey { topTracksView.PlaySelectedEntry(); return nil }, pBar),
|
||||
})
|
||||
|
||||
App.SetInputCapture(func(e *tcell.EventKey) *tcell.EventKey {
|
||||
if e.Rune() == '1' {
|
||||
Ui.App.SetFocus(NavMenu.Table)
|
||||
|
||||
@@ -42,7 +42,7 @@ func (a *TopTracksView) Content() func() [][]Content {
|
||||
for _, v := range a.topArtists {
|
||||
c = append(c, []Content{
|
||||
{Content: v.Name, Style: ArtistStyle},
|
||||
{Content: v.Genres[0], Style: AlbumStyle},
|
||||
{Content: v.Genres[0], Style: GenreStyle},
|
||||
})
|
||||
}
|
||||
c = append(c, []Content{{"Top Tracks:", NotSelectableStyle}})
|
||||
|
||||
Reference in New Issue
Block a user