add right-click menu to toggle tracklist columns
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user