mirror of
https://github.com/taigrr/wtf
synced 2026-04-02 02:28:55 -07:00
Close #204. Add Trello dependency to /vendor
This commit is contained in:
17
vendor/github.com/rivo/tview/flex.go
generated
vendored
17
vendor/github.com/rivo/tview/flex.go
generated
vendored
@@ -28,7 +28,7 @@ type Flex struct {
|
||||
*Box
|
||||
|
||||
// The items to be positioned.
|
||||
items []flexItem
|
||||
items []*flexItem
|
||||
|
||||
// FlexRow or FlexColumn.
|
||||
direction int
|
||||
@@ -86,7 +86,7 @@ func (f *Flex) SetFullScreen(fullScreen bool) *Flex {
|
||||
// You can provide a nil value for the primitive. This will still consume screen
|
||||
// space but nothing will be drawn.
|
||||
func (f *Flex) AddItem(item Primitive, fixedSize, proportion int, focus bool) *Flex {
|
||||
f.items = append(f.items, flexItem{Item: item, FixedSize: fixedSize, Proportion: proportion, Focus: focus})
|
||||
f.items = append(f.items, &flexItem{Item: item, FixedSize: fixedSize, Proportion: proportion, Focus: focus})
|
||||
return f
|
||||
}
|
||||
|
||||
@@ -101,6 +101,19 @@ func (f *Flex) RemoveItem(p Primitive) *Flex {
|
||||
return f
|
||||
}
|
||||
|
||||
// ResizeItem sets a new size for the item(s) with the given primitive. If there
|
||||
// are multiple Flex items with the same primitive, they will all receive the
|
||||
// same size. For details regarding the size parameters, see AddItem().
|
||||
func (f *Flex) ResizeItem(p Primitive, fixedSize, proportion int) *Flex {
|
||||
for _, item := range f.items {
|
||||
if item.Item == p {
|
||||
item.FixedSize = fixedSize
|
||||
item.Proportion = proportion
|
||||
}
|
||||
}
|
||||
return f
|
||||
}
|
||||
|
||||
// Draw draws this primitive onto the screen.
|
||||
func (f *Flex) Draw(screen tcell.Screen) {
|
||||
f.Box.Draw(screen)
|
||||
|
||||
Reference in New Issue
Block a user