add right-click menu to toggle tracklist columns

This commit is contained in:
Drew Weymouth
2023-02-18 19:46:19 -08:00
parent 4297e3318a
commit 5a352e3c6e
4 changed files with 108 additions and 8 deletions
+10 -2
View File
@@ -99,8 +99,7 @@ func NewPlaylistList() *PlaylistList {
a := &PlaylistList{
columnsLayout: layouts.NewColumnsLayout([]float32{-1, -1, 200, 125}),
}
a.header = widgets.NewListHeader(
[]widgets.ListColumn{{"Name", false}, {"Description", false}, {"Owner", false}, {"Track Count", true}}, a.columnsLayout)
a.buildHeader()
a.list = widget.NewList(
func() int {
return len(a.Playlists)
@@ -125,6 +124,15 @@ func NewPlaylistList() *PlaylistList {
return a
}
func (p *PlaylistList) buildHeader() {
p.header = widgets.NewListHeader([]widgets.ListColumn{
{"Name", false, false},
{"Description", false, false},
{"Owner", false, false},
{"Track Count", true, false}}, p.columnsLayout)
}
func (p *PlaylistList) CreateRenderer() fyne.WidgetRenderer {
return widget.NewSimpleRenderer(p.container)
}