From 7d13baadc84d7377a352c6d58ed9deeea2c918be Mon Sep 17 00:00:00 2001 From: Adam <2363879+adamdotdevin@users.noreply.github.com> Date: Thu, 26 Jun 2025 10:16:07 -0500 Subject: feat: default system theme (#419) Co-authored-by: adamdottv <2363879+adamdottv@users.noreply.github.com> --- packages/tui/internal/layout/container.go | 5 ++--- packages/tui/internal/layout/flex.go | 5 +++-- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'packages/tui/internal/layout') diff --git a/packages/tui/internal/layout/container.go b/packages/tui/internal/layout/container.go index 3eda158cc..250034ebc 100644 --- a/packages/tui/internal/layout/container.go +++ b/packages/tui/internal/layout/container.go @@ -3,6 +3,7 @@ package layout import ( tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/lipgloss/v2" + "github.com/sst/opencode/internal/styles" "github.com/sst/opencode/internal/theme" ) @@ -57,7 +58,7 @@ func (c *container) Update(msg tea.Msg) (tea.Model, tea.Cmd) { func (c *container) View() string { t := theme.CurrentTheme() - style := lipgloss.NewStyle() + style := styles.NewStyle().Background(t.Background()) width := c.width height := c.height @@ -66,8 +67,6 @@ func (c *container) View() string { width = c.maxWidth } - style = style.Background(t.Background()) - // Apply border if any side is enabled if c.borderTop || c.borderRight || c.borderBottom || c.borderLeft { // Adjust width and height for borders diff --git a/packages/tui/internal/layout/flex.go b/packages/tui/internal/layout/flex.go index 35f6ba164..320a95203 100644 --- a/packages/tui/internal/layout/flex.go +++ b/packages/tui/internal/layout/flex.go @@ -3,6 +3,7 @@ package layout import ( tea "github.com/charmbracelet/bubbletea/v2" "github.com/charmbracelet/lipgloss/v2" + "github.com/sst/opencode/internal/styles" "github.com/sst/opencode/internal/theme" ) @@ -66,7 +67,7 @@ func (f *flexLayout) View() string { alignment, child.View(), // TODO: make configurable WithBackgroundStyle - lipgloss.WithWhitespaceStyle(lipgloss.NewStyle().Background(t.Background())), + lipgloss.WithWhitespaceStyle(styles.NewStyle().Background(t.Background()).Lipgloss()), ) views = append(views, view) } else { @@ -78,7 +79,7 @@ func (f *flexLayout) View() string { alignment, child.View(), // TODO: make configurable WithBackgroundStyle - lipgloss.WithWhitespaceStyle(lipgloss.NewStyle().Background(t.Background())), + lipgloss.WithWhitespaceStyle(styles.NewStyle().Background(t.Background()).Lipgloss()), ) views = append(views, view) } -- cgit v1.2.3