Fixed bug with vertical layout being cringe
This commit is contained in:
parent
3ddeeb5469
commit
1c7467c4bc
@ -27,12 +27,14 @@ func (layout Vertical) Arrange (entries []tomo.LayoutEntry, width, height int) {
|
|||||||
|
|
||||||
// count the number of expanding elements and the amount of free space
|
// count the number of expanding elements and the amount of free space
|
||||||
// for them to collectively occupy
|
// for them to collectively occupy
|
||||||
for _, entry := range entries {
|
for index, entry := range entries {
|
||||||
if entry.Expand {
|
if entry.Expand {
|
||||||
expandingElements ++
|
expandingElements ++
|
||||||
} else {
|
} else {
|
||||||
_, entryMinHeight := entry.MinimumSize()
|
_, entryMinHeight := entry.MinimumSize()
|
||||||
freeSpace -= entryMinHeight
|
freeSpace -= entryMinHeight
|
||||||
|
}
|
||||||
|
if index > 0 {
|
||||||
freeSpace -= theme.Padding()
|
freeSpace -= theme.Padding()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user