working on tui
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user