Compare commits
No commits in common. "fcb23827e45f00b9bca813c38b72c4eb9906a74d" and "1cc6d923fcc0e19a622d3b37f2441ed23b83778e" have entirely different histories.
fcb23827e4
...
1cc6d923fc
16
bubbletea.go
16
bubbletea.go
@ -50,17 +50,10 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
|
|
||||||
// new task
|
// new task
|
||||||
case "n":
|
case "n":
|
||||||
if !m.addTask {
|
|
||||||
m.addTask = true
|
m.addTask = true
|
||||||
m.textinput.Focus()
|
|
||||||
m.textinput.Reset()
|
|
||||||
}
|
|
||||||
|
|
||||||
case "esc":
|
case "esc":
|
||||||
if m.addTask {
|
|
||||||
m.addTask = false
|
m.addTask = false
|
||||||
m.textinput.Reset()
|
|
||||||
}
|
|
||||||
|
|
||||||
// The "enter" key and the spacebar (a literal space) toggle
|
// The "enter" key and the spacebar (a literal space) toggle
|
||||||
// the selected state for the item that the cursor is pointing at.
|
// the selected state for the item that the cursor is pointing at.
|
||||||
@ -73,9 +66,9 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if m.addTask {
|
|
||||||
m.textinput, cmd = m.textinput.Update(msg)
|
m.textinput, cmd = m.textinput.Update(msg)
|
||||||
}
|
|
||||||
// Return the updated model to the Bubble Tea runtime for processing.
|
// Return the updated model to the Bubble Tea runtime for processing.
|
||||||
// Note that we're not returning a command.
|
// Note that we're not returning a command.
|
||||||
return m, cmd
|
return m, cmd
|
||||||
@ -125,7 +118,8 @@ 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().
|
s += lipgloss.
|
||||||
|
NewStyle().
|
||||||
Bold(true).
|
Bold(true).
|
||||||
Underline(true).
|
Underline(true).
|
||||||
PaddingRight(3).
|
PaddingRight(3).
|
||||||
@ -142,6 +136,8 @@ func (m model) View() string {
|
|||||||
|
|
||||||
if m.addTask {
|
if m.addTask {
|
||||||
s += ": "
|
s += ": "
|
||||||
|
m.textinput.Focus()
|
||||||
|
m.textinput.Cursor.BlinkCmd()
|
||||||
s += m.textinput.View()
|
s += m.textinput.View()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user