diff options
| author | Adam <[email protected]> | 2025-06-26 10:16:07 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-06-26 10:16:07 -0500 |
| commit | 7d13baadc84d7377a352c6d58ed9deeea2c918be (patch) | |
| tree | 575b6897431e390ae8bf4b9ccde2803446c6c67a /packages/tui/internal/components/status | |
| parent | db24bf87c01d3fff2a9594e55e9fab0d9ef52cfe (diff) | |
| download | opencode-7d13baadc84d7377a352c6d58ed9deeea2c918be.tar.gz opencode-7d13baadc84d7377a352c6d58ed9deeea2c918be.zip | |
feat: default system theme (#419)
Co-authored-by: adamdottv <[email protected]>
Diffstat (limited to 'packages/tui/internal/components/status')
| -rw-r--r-- | packages/tui/internal/components/status/status.go | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/packages/tui/internal/components/status/status.go b/packages/tui/internal/components/status/status.go index 62d207088..fb5ff8ced 100644 --- a/packages/tui/internal/components/status/status.go +++ b/packages/tui/internal/components/status/status.go @@ -36,14 +36,15 @@ func (m statusComponent) Update(msg tea.Msg) (tea.Model, tea.Cmd) { func (m statusComponent) logo() string { t := theme.CurrentTheme() - base := lipgloss.NewStyle().Background(t.BackgroundElement()).Foreground(t.TextMuted()).Render - emphasis := lipgloss.NewStyle().Bold(true).Background(t.BackgroundElement()).Foreground(t.Text()).Render + base := styles.NewStyle().Foreground(t.TextMuted()).Background(t.BackgroundElement()).Render + emphasis := styles.NewStyle().Foreground(t.Text()).Background(t.BackgroundElement()).Bold(true).Render open := base("open") code := emphasis("code ") version := base(m.app.Version) - return styles.Padded(). + return styles.NewStyle(). Background(t.BackgroundElement()). + Padding(0, 1). Render(open + code + version) } @@ -77,7 +78,7 @@ func formatTokensAndCost(tokens float32, contextWindow float32, cost float32) st func (m statusComponent) View() string { t := theme.CurrentTheme() if m.app.Session.Id == "" { - return styles.BaseStyle(). + return styles.NewStyle(). Background(t.Background()). Width(m.width). Height(2). @@ -86,9 +87,10 @@ func (m statusComponent) View() string { logo := m.logo() - cwd := styles.Padded(). + cwd := styles.NewStyle(). Foreground(t.TextMuted()). Background(t.BackgroundPanel()). + Padding(0, 1). Render(m.app.Info.Path.Cwd) sessionInfo := "" @@ -111,9 +113,10 @@ func (m statusComponent) View() string { } } - sessionInfo = styles.Padded(). - Background(t.BackgroundElement()). + sessionInfo = styles.NewStyle(). Foreground(t.TextMuted()). + Background(t.BackgroundElement()). + Padding(0, 1). Render(formatTokensAndCost(tokens, contextWindow, cost)) } @@ -123,11 +126,11 @@ func (m statusComponent) View() string { 0, m.width-lipgloss.Width(logo)-lipgloss.Width(cwd)-lipgloss.Width(sessionInfo), ) - spacer := lipgloss.NewStyle().Background(t.BackgroundPanel()).Width(space).Render("") + spacer := styles.NewStyle().Background(t.BackgroundPanel()).Width(space).Render("") status := logo + cwd + spacer + sessionInfo - blank := styles.BaseStyle().Background(t.Background()).Width(m.width).Render("") + blank := styles.NewStyle().Background(t.Background()).Width(m.width).Render("") return blank + "\n" + status } |
