summaryrefslogtreecommitdiff
path: root/internal/client/ui/layouts/flex/flex.go
diff options
context:
space:
mode:
authorKyren223 <Kyren223@proton.me>2024-11-25 23:49:40 +0200
committerKyren223 <Kyren223@proton.me>2024-11-25 23:49:40 +0200
commitb05e4fcbcb59bdf20ca7b3e27f8ed15fea594cad (patch)
tree96dbcdf57b6e2958d99a803197f5b3210f0c5bc5 /internal/client/ui/layouts/flex/flex.go
parentd12ebef2c5b1fdc17d4151f752d4e4d95f6e56b3 (diff)
Added typing and input validation to network creation popup
Diffstat (limited to 'internal/client/ui/layouts/flex/flex.go')
-rw-r--r--internal/client/ui/layouts/flex/flex.go19
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
+}