[WIP] table formatting

This commit is contained in:
Martin Pander
2024-05-24 17:17:58 +02:00
parent 1086b19765
commit f7b54b607b
6 changed files with 587 additions and 117 deletions

View File

@ -7,16 +7,19 @@ import (
"strconv"
"strings"
// "github.com/charmbracelet/bubbles/table"
"github.com/charmbracelet/huh"
"github.com/charmbracelet/lipgloss"
"tasksquire/components/table"
"tasksquire/taskwarrior"
)
type Styles struct {
Main lipgloss.Style
Form *huh.Theme
Form *huh.Theme
TableStyle table.Styles
Active lipgloss.Style
Alternate lipgloss.Style
@ -71,6 +74,13 @@ func NewStyles(config *taskwarrior.TWConfig) *Styles {
styles := parseColors(config.GetConfig())
styles.Main = lipgloss.NewStyle()
styles.TableStyle = table.Styles{
// Header: lipgloss.NewStyle().Bold(true).Padding(0, 1).BorderBottom(true),
Cell: lipgloss.NewStyle().Padding(0, 1, 0, 0),
Header: lipgloss.NewStyle().Bold(true).Padding(0, 1, 0, 0).Underline(true),
Selected: lipgloss.NewStyle().Foreground(styles.Active.GetForeground()).Background(styles.Active.GetBackground()).Bold(true).Reverse(true),
}
formTheme := huh.ThemeBase()
formTheme.Focused.Title = formTheme.Focused.Title.Bold(true)
formTheme.Focused.SelectSelector = formTheme.Focused.SelectSelector.SetString("> ")