diff options
Diffstat (limited to 'internal/tui/layout')
| -rw-r--r-- | internal/tui/layout/split.go | 24 |
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 { |
