summaryrefslogtreecommitdiffhomepage
path: root/internal/tui/layout/split.go
diff options
context:
space:
mode:
authorKujtim Hoxha <[email protected]>2025-04-12 02:01:45 +0200
committerKujtim Hoxha <[email protected]>2025-04-21 13:38:42 +0200
commit8d874b839db169906e18e4277cd198504018e022 (patch)
tree658a1adbee42a0ca2249252827fb37f7469f3667 /internal/tui/layout/split.go
parent08bd75bb6e1fde0427dfd37204ee9a3c43bb1e5b (diff)
downloadopencode-8d874b839db169906e18e4277cd198504018e022.tar.gz
opencode-8d874b839db169906e18e4277cd198504018e022.zip
add initial message handling
Diffstat (limited to 'internal/tui/layout/split.go')
-rw-r--r--internal/tui/layout/split.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/tui/layout/split.go b/internal/tui/layout/split.go
index 2a6822c7e..0ed85dd6f 100644
--- a/internal/tui/layout/split.go
+++ b/internal/tui/layout/split.go
@@ -10,6 +10,9 @@ import (
type SplitPaneLayout interface {
tea.Model
Sizeable
+ SetLeftPanel(panel Container)
+ SetRightPanel(panel Container)
+ SetBottomPanel(panel Container)
}
type splitPaneLayout struct {
@@ -160,6 +163,27 @@ func (s *splitPaneLayout) GetSize() (int, int) {
return s.width, s.height
}
+func (s *splitPaneLayout) SetLeftPanel(panel Container) {
+ s.leftPanel = panel
+ if s.width > 0 && s.height > 0 {
+ s.SetSize(s.width, s.height)
+ }
+}
+
+func (s *splitPaneLayout) SetRightPanel(panel Container) {
+ s.rightPanel = panel
+ if s.width > 0 && s.height > 0 {
+ s.SetSize(s.width, s.height)
+ }
+}
+
+func (s *splitPaneLayout) SetBottomPanel(panel Container) {
+ s.bottomPanel = panel
+ if s.width > 0 && s.height > 0 {
+ s.SetSize(s.width, s.height)
+ }
+}
+
func (s *splitPaneLayout) BindingKeys() []key.Binding {
keys := []key.Binding{}
if s.leftPanel != nil {