Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion flex.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type Flex struct {
// background before any items are drawn, set it to a box with the desired
// color:
//
// flex.Box = NewBox()
// flex.Box = NewBox()
func NewFlex() *Flex {
f := &Flex{
direction: FlexColumn,
Expand Down Expand Up @@ -137,6 +137,15 @@ func (f *Flex) ResizeItem(p Primitive, fixedSize, proportion int) *Flex {
return f
}

// ResizeItemAt sets a new size for the item ath the given index.
// For details regarding the size parameters, see AddItem().
func (f *Flex) ResizeItemAt(index int, fixedSize, proportion int) *Flex {
item := f.items[index]
item.FixedSize = fixedSize
item.Proportion = proportion
return f
}

// Draw draws this primitive onto the screen.
func (f *Flex) Draw(screen tcell.Screen) {
f.Box.DrawForSubclass(screen, f)
Expand Down