Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions internal/tui/overlay.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ func placeOverlay(x, y int, fg, bg string, opts ...WhitespaceOption) string {

var b strings.Builder

b.WriteString("\x1b_Ga=d\x1b\\")

for i, bgLine := range bgLines {
if i > 0 {
b.WriteByte('\n')
Expand Down
6 changes: 1 addition & 5 deletions internal/tui/slide.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ func (s *Slide) Update() (*Slide, tea.Cmd) {
transition, cmd := s.ActiveTransition.Update()
s.ActiveTransition = transition

// Update timer
// var timerCmd tea.Cmd
// s.Timer, timerCmd = s.Timer.Update(TimerTickMsg{})

return s, tea.Batch(cmd)
return s, cmd
}

func (s *Slide) View(animating bool) string {
Expand Down
19 changes: 12 additions & 7 deletions internal/tui/tui.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package tui

import (
"fmt"
"log/slog"
"time"

"github.com/charmbracelet/bubbles/help"
"github.com/charmbracelet/bubbles/key"
Expand Down Expand Up @@ -159,9 +161,9 @@ func (m model) Init() tea.Cmd {

return tea.Batch(
tea.ClearScreen,
// tea.Tick(time.Second, func(time.Time) tea.Msg {
// return TimerTickMsg{}
// }),
tea.Tick(time.Second, func(time.Time) tea.Msg {
return TimerTickMsg{}
}),
)
}

Expand Down Expand Up @@ -323,10 +325,11 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
slide, cmd := m.slide.Update()
m.slide = slide
return m, cmd
// case TimerTickMsg:
// var cmd tea.Cmd
// m.globalTimer, cmd = m.globalTimer.Update(msg)
// return m, cmd
case TimerTickMsg:
var cmd tea.Cmd
m.globalTimer, cmd = m.globalTimer.Update(msg)
m.slide.Timer, _ = m.slide.Timer.Update(msg)
return m, cmd
}

return m, nil
Expand All @@ -350,10 +353,12 @@ func (m model) View() string {
)

if m.command != nil && m.command.IsShowing() {
fmt.Print("\x1b_Ga=d\x1b\\")
return m.command.Show(slideView, m.width, m.height)
}

if m.goTo != nil && m.goTo.IsShowing() {
fmt.Print("\x1b_Ga=d\x1b\\")
return m.goTo.Show(slideView, m.width, m.height)
}

Expand Down