align numeric list columns to the right

This commit is contained in:
Drew Weymouth
2023-02-03 18:44:00 -08:00
parent 320bd9d8c3
commit 3b3dc780af
4 changed files with 24 additions and 8 deletions
+3 -1
View File
@@ -99,7 +99,8 @@ func NewPlaylistList() *PlaylistList {
a := &PlaylistList{
columnsLayout: layouts.NewColumnsLayout([]float32{-1, -1, 200, 125}),
}
a.header = widgets.NewListHeader([]string{"Name", "Description", "Owner", "Track Count"}, a.columnsLayout)
a.header = widgets.NewListHeader(
[]widgets.ListColumn{{"Name", false}, {"Description", false}, {"Owner", false}, {"Track Count", true}}, a.columnsLayout)
a.list = widget.NewList(
func() int {
return len(a.Playlists)
@@ -155,6 +156,7 @@ func NewPlaylistListRow(layout *layouts.ColumnsLayout) *PlaylistListRow {
ownerLabel: widget.NewLabel(""),
trackCountLabel: widget.NewLabel(""),
}
a.trackCountLabel.Alignment = fyne.TextAlignTrailing
a.ownerLabel.Wrapping = fyne.TextTruncate
a.container = container.New(layout, a.nameLabel, a.descrptionLabel, a.ownerLabel, a.trackCountLabel)
a.ExtendBaseWidget(a)