* refactor(tui): port to charm v2 bumped bubbletea, lipgloss, bubbles, wish, and huh to v2. Mostly mechanical chur, new import paths, vewport getter/setter api, view() returns tea.view now, huh.theme became an interface so the theme package needed a small reshape. Render plumbing is gone (no more lipgloss.Render field on the Model or MakeRenderer in main.go). All pages still work over ssh. setting up for the refund composer next * style(tui): gofmt main.go and menu.go
26 lines
657 B
Go
26 lines
657 B
Go
package tui
|
|
|
|
import (
|
|
"strings"
|
|
|
|
"charm.land/lipgloss/v2"
|
|
)
|
|
|
|
func (m Model) BuildFooter() string {
|
|
keybindStyle := m.theme.TextDim().Bold(true)
|
|
descStyle := m.theme.TextDim()
|
|
|
|
if m.size == small {
|
|
footerText := keybindStyle.Render("m") + " " + descStyle.Render("menu")
|
|
return lipgloss.NewStyle().Align(lipgloss.Center).Width(m.widthContainer).Render(footerText)
|
|
}
|
|
|
|
parts := []string{}
|
|
for _, cmd := range m.footer {
|
|
parts = append(parts, keybindStyle.Render(cmd.key)+" "+descStyle.Render(cmd.value))
|
|
}
|
|
footerText := strings.Join(parts, " ")
|
|
|
|
return lipgloss.NewStyle().Align(lipgloss.Center).Width(m.widthContainer).Render(footerText)
|
|
}
|