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 // render tab bar
for i, v := range []string{"Inbox", "Today", "Tomorrow", "Scheduled", "Anytime"} { for i, v := range []string{"Inbox", "Today", "Tomorrow", "Scheduled", "Anytime"} {
if i == m.tab { 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 { } 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" s += "\nn: new"
if m.addTask { if m.addTask {
s += ": >" s += ": "
m.textinput.Prompt = "New Task..." m.textinput.Focus()
m.textinput.Cursor.BlinkCmd()
s += m.textinput.View() s += m.textinput.View()
} }

View File

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