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
@@ -61,7 +61,9 @@ func ExampleStack() {
|
||||
mujica.Use(c, mujica.Settings{})
|
||||
mujica.Stack(c, mujica.StackOptions{Horizontal: true, Gap: mujica.SpaceM}, func() {
|
||||
mujica.Button(c, "Save", mujica.ButtonOptions{})
|
||||
mujica.StackItem(!showDraft, func() { mujica.Button(c, "Draft", mujica.ButtonOptions{Variant: mujica.Secondary}) })
|
||||
if showDraft {
|
||||
mujica.Button(c, "Draft", mujica.ButtonOptions{Variant: mujica.Secondary})
|
||||
}
|
||||
mujica.Button(c, "Cancel", mujica.ButtonOptions{Variant: mujica.Ghost})
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user