add flex.ResizeItemAt

pull/801/head
Gergely Bódi 1 year ago
parent 892d1a2eb0
commit 207dd25041

@ -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,
@ -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)

Loading…
Cancel
Save