Refactor: delete StackItem
Callers skip a hidden child with if !hidden { build() }; an unbuilt
child already takes no room and no gap. Docs, Example and Gallery
updated.
This commit is contained in:
5 files changed
+17
-25
No files matched your search
+3
-2
@@ -30,7 +30,9 @@ func TestStackHiddenItemTakesNoGap(t *testing.T) {
|
||||
Use(c, Settings{})
|
||||
Stack(c, StackOptions{Horizontal: true, Gap: SpaceL}, func() {
|
||||
a = ui.Box(c).Size(30, 10).Bounds()
|
||||
StackItem(hide, func() { ui.Box(c).Size(30, 10) })
|
||||
if !hide {
|
||||
ui.Box(c).Size(30, 10)
|
||||
}
|
||||
last = ui.Box(c).Size(30, 10).Bounds()
|
||||
})
|
||||
}, 300, 300).Frame()
|
||||
@@ -105,7 +107,6 @@ func TestStackSnapshot(t *testing.T) {
|
||||
})
|
||||
Stack(c, StackOptions{Horizontal: true, Justify: ui.SpaceBetween}, func() {
|
||||
chip("Start")
|
||||
StackItem(true, func() { chip("Hidden") })
|
||||
chip("Between")
|
||||
chip("End")
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user