Progress?
This commit is contained in:
parent
40bdffc8be
commit
7398f146ba
@ -300,7 +300,6 @@ func (element *Container) HandleSelection (direction tomo.SelectionDirection) (o
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// FIXME: fix this!
|
|
||||||
func (element *Container) MinimumHeightFor (width int) (height int) {
|
func (element *Container) MinimumHeightFor (width int) (height int) {
|
||||||
return element.layout.MinimumHeightFor(element.children, width)
|
return element.layout.MinimumHeightFor(element.children, width)
|
||||||
}
|
}
|
||||||
|
@ -106,14 +106,18 @@ func (layout Vertical) MinimumSize (
|
|||||||
// specified elements at the given width, taking into account flexible elements.
|
// specified elements at the given width, taking into account flexible elements.
|
||||||
func (layout Vertical) MinimumHeightFor (
|
func (layout Vertical) MinimumHeightFor (
|
||||||
entries []tomo.LayoutEntry,
|
entries []tomo.LayoutEntry,
|
||||||
squeeze int,
|
width int,
|
||||||
) (
|
) (
|
||||||
height int,
|
height int,
|
||||||
) {
|
) {
|
||||||
|
if layout.Pad {
|
||||||
|
width -= theme.Padding() * 2
|
||||||
|
}
|
||||||
|
|
||||||
for index, entry := range entries {
|
for index, entry := range entries {
|
||||||
child, flexible := entry.Element.(tomo.Flexible)
|
child, flexible := entry.Element.(tomo.Flexible)
|
||||||
if flexible {
|
if flexible {
|
||||||
height += child.MinimumHeightFor(squeeze)
|
height += child.MinimumHeightFor(width)
|
||||||
} else {
|
} else {
|
||||||
_, entryHeight := entry.MinimumSize()
|
_, entryHeight := entry.MinimumSize()
|
||||||
height += entryHeight
|
height += entryHeight
|
||||||
|
Reference in New Issue
Block a user