From 8d874b839db169906e18e4277cd198504018e022 Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Sat, 12 Apr 2025 02:01:45 +0200 Subject: add initial message handling --- internal/tui/layout/split.go | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'internal/tui/layout') 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 { -- cgit v1.2.3