Skip to content

Commit

Permalink
Move Max to Stack
Browse files Browse the repository at this point in the history
Fixes #24
  • Loading branch information
andydotxyz committed Aug 20, 2024
1 parent 8c7fe57 commit b0c2ea5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion _data/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
- border
- form
- center
- max
- stack
- apptabs
- title: Widgets
sectionid: widget
Expand Down
9 changes: 5 additions & 4 deletions container/max.md → container/stack.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ title: Max

redirect_from:
- /tour/layout/maxlayout
- /container/max
---

The `layout.MaxLayout` is the simplest layout, it sets all items in
The `layout.NewStackLayout()` is the simplest layout, it sets all items in
the container to be the same size as the container. This is not
often useful in general containers but can be suitable when composing
widgets.

The max layout will expand the container to be at least the size of the
The stack layout will require the container to be at least the size of the
largest item's minimum size. The objects will be drawn in the order
the are passed to the container, with the last being drawn top-most.

Expand All @@ -29,11 +30,11 @@ import (

func main() {
myApp := app.New()
myWindow := myApp.NewWindow("Max Layout")
myWindow := myApp.NewWindow("Stack Layout")

img := canvas.NewImageFromResource(theme.FyneLogo())
text := canvas.NewText("Overlay", color.Black)
content := container.New(layout.NewMaxLayout(), img, text)
content := container.New(layout.NewStackLayout(), img, text)

myWindow.SetContent(content)
myWindow.ShowAndRun()
Expand Down

0 comments on commit b0c2ea5

Please sign in to comment.