diff options
| author | adamdottv <[email protected]> | 2025-04-28 08:46:09 -0500 |
|---|---|---|
| committer | adamdottv <[email protected]> | 2025-04-30 07:46:34 -0500 |
| commit | 61b605e724eb4cc50ab831534fcdd18e031d68eb (patch) | |
| tree | b15b074a8fed1931e179a8d3df08d05b753c7aa3 /internal/tui/layout/split.go | |
| parent | 61d9dc95111d2645a49816f6d9d6cc1014be1a22 (diff) | |
| download | opencode-61b605e724eb4cc50ab831534fcdd18e031d68eb.tar.gz opencode-61b605e724eb4cc50ab831534fcdd18e031d68eb.zip | |
feat: themes
Diffstat (limited to 'internal/tui/layout/split.go')
| -rw-r--r-- | internal/tui/layout/split.go | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/internal/tui/layout/split.go b/internal/tui/layout/split.go index 6763e408c..2684a8447 100644 --- a/internal/tui/layout/split.go +++ b/internal/tui/layout/split.go @@ -4,7 +4,7 @@ import ( "github.com/charmbracelet/bubbles/key" tea "github.com/charmbracelet/bubbletea" "github.com/charmbracelet/lipgloss" - "github.com/opencode-ai/opencode/internal/tui/styles" + "github.com/opencode-ai/opencode/internal/tui/theme" ) type SplitPaneLayout interface { @@ -29,8 +29,6 @@ type splitPaneLayout struct { rightPanel Container leftPanel Container bottomPanel Container - - backgroundColor lipgloss.TerminalColor } type SplitPaneOption func(*splitPaneLayout) @@ -113,11 +111,13 @@ func (s *splitPaneLayout) View() string { finalView = topSection } - if s.backgroundColor != nil && finalView != "" { + if finalView != "" { + t := theme.CurrentTheme() + style := lipgloss.NewStyle(). Width(s.width). Height(s.height). - Background(s.backgroundColor) + Background(t.Background()) return style.Render(finalView) } @@ -241,10 +241,10 @@ func (s *splitPaneLayout) BindingKeys() []key.Binding { } func NewSplitPane(options ...SplitPaneOption) SplitPaneLayout { + layout := &splitPaneLayout{ - ratio: 0.7, - verticalRatio: 0.9, // Default 80% for top section, 20% for bottom - backgroundColor: styles.Background, + ratio: 0.7, + verticalRatio: 0.9, // Default 90% for top section, 10% for bottom } for _, option := range options { option(layout) @@ -270,12 +270,6 @@ func WithRatio(ratio float64) SplitPaneOption { } } -func WithSplitBackgroundColor(color lipgloss.TerminalColor) SplitPaneOption { - return func(s *splitPaneLayout) { - s.backgroundColor = color - } -} - func WithBottomPanel(panel Container) SplitPaneOption { return func(s *splitPaneLayout) { s.bottomPanel = panel |
