From e12c3213df812fdc0b21eba3d918c68b05d2502a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Paul=20B=C3=BCtow?= <1224732+snonux@users.noreply.github.com> Date: Fri, 20 Jun 2025 18:35:48 +0300 Subject: Add option to hide headers --- internal/ui/table.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'internal/ui/table.go') diff --git a/internal/ui/table.go b/internal/ui/table.go index 51bd9e4..c8ec17d 100644 --- a/internal/ui/table.go +++ b/internal/ui/table.go @@ -64,6 +64,7 @@ func newTable(rows []atable.Row) atable.Model { atable.WithColumns(cols), atable.WithRows(rows), atable.WithFocused(true), + atable.WithShowHeaders(false), ) styles := atable.DefaultStyles() styles.Header = styles.Header.Foreground(lipgloss.Color("205")) @@ -185,7 +186,12 @@ func (m Model) View() string { } func (m Model) statusLine() string { - status := fmt.Sprintf("Total:%d InProgress:%d Due:%d", m.total, m.inProgress, m.due) + header := "" + cols := m.tbl.Columns() + if idx := m.tbl.ColumnCursor(); idx >= 0 && idx < len(cols) { + header = cols[idx].Title + } + status := fmt.Sprintf("%s Total:%d InProgress:%d Due:%d", header, m.total, m.inProgress, m.due) return lipgloss.NewStyle(). Foreground(lipgloss.Color("229")). Background(lipgloss.Color("57")). -- cgit v1.2.3