working on tui

This commit is contained in:
2026-08-27 15:49:18 +01:00
parent 3ea14b91c0
commit 71961f68da
5 changed files with 167 additions and 51 deletions
+7
View File
@@ -35,6 +35,7 @@ type Model struct {
form FormModel
result GenerateResult
spinner spinnerState
isDark bool
width int
height int
}
@@ -43,6 +44,7 @@ func New() Model {
return Model{
state: StateForm,
form: NewForm(),
isDark: true,
}
}
@@ -52,6 +54,11 @@ func (m Model) Init() tea.Cmd {
func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.BackgroundColorMsg:
m.isDark = msg.IsDark()
m.form.SetDark(m.isDark)
return m, nil
case tea.WindowSizeMsg:
m.width = msg.Width
m.height = msg.Height