More textinput tests, more lipglos

This commit is contained in:
june 2025-03-09 10:57:47 +13:00
parent ac37f53069
commit 1cc6d923fc
Signed by untrusted user who does not match committer: breadone
GPG Key ID: FDC19FE143200483
2 changed files with 20 additions and 4 deletions

View File

@ -118,9 +118,16 @@ func (m model) View() string {
// render tab bar
for i, v := range []string{"Inbox", "Today", "Tomorrow", "Scheduled", "Anytime"} {
if i == m.tab {
s += lipgloss.NewStyle().Bold(true).Render(fmt.Sprintf("%s ", v))
s += lipgloss.
NewStyle().
Bold(true).
Underline(true).
PaddingRight(3).
Render(v)
} else {
s += fmt.Sprintf("%s ", v)
s += lipgloss.NewStyle().
PaddingRight(3).
Render(v)
}
}
@ -128,8 +135,9 @@ func (m model) View() string {
s += "\nn: new"
if m.addTask {
s += ": >"
m.textinput.Prompt = "New Task..."
s += ": "
m.textinput.Focus()
m.textinput.Cursor.BlinkCmd()
s += m.textinput.View()
}

View File

@ -24,7 +24,15 @@ type model struct {
}
func initialModel() model {
ti := textinput.New()
ti.Placeholder = "New Task"
// ti.Focus()
// ti.CharLimit = 156
// ti.Width = 20
return model{
textinput: ti,
// Start empty
todos: []todo{},