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:
ZacharyZhang-NY committed 2026-10-05 13:48:13 -04:00
1 parent dbed3b603f
commit 5f217100ff
5 files changed
+17 -25

No files matched your search

+3 -2
View File
@@ -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")
})