make date column header in table depend on mode

This commit is contained in:
Lilian Jónsdóttir 2024-07-30 11:51:12 -07:00
parent 9b87c02744
commit 84e0c9c926

View file

@ -94,10 +94,18 @@ func newModel(fls []files.File, width, height int, readonly, preselected, once b
rows := mdl.freshRows(preselected) rows := mdl.freshRows(preselected)
var datecolumn string
switch mdl.mode {
case modes.Trashing:
datecolumn = "modified"
default:
datecolumn = "trashed"
}
columns := []table.Column{ columns := []table.Column{
{Title: "filename", Width: fwidth}, {Title: "filename", Width: fwidth},
{Title: "path", Width: owidth}, {Title: "path", Width: owidth},
{Title: "modified", Width: dwidth}, {Title: datecolumn, Width: dwidth},
{Title: "size", Width: swidth}, {Title: "size", Width: swidth},
} }
if !mdl.readonly { if !mdl.readonly {