diff options
Diffstat (limited to 'internal/client/ui/layouts')
| -rw-r--r-- | internal/client/ui/layouts/flex/flex.go | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/internal/client/ui/layouts/flex/flex.go b/internal/client/ui/layouts/flex/flex.go index 6f39ec1..def7a18 100644 --- a/internal/client/ui/layouts/flex/flex.go +++ b/internal/client/ui/layouts/flex/flex.go @@ -16,8 +16,18 @@ type Model struct { Vertical bool } -func New() Model { - return Model{} +func NewHorizontal(contents ...string) Model { + return Model{ + contents: contents, + Vertical: false, + } +} + +func NewVertical(contents ...string) Model { + return Model{ + contents: contents, + Vertical: true, + } } func (m Model) Init() tea.Cmd { @@ -54,3 +64,8 @@ func (m Model) Update(msg tea.Msg) (Model, tea.Cmd) { func (m *Model) SetContents(contents ...string) { m.contents = contents } + +func (m Model) WithGap(gap int) Model { + m.Gap = gap + return m +} |
