-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add note to stacklayout about single object #4162
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment doesn't seem quite right
container/layouts.go
Outdated
@@ -102,6 +102,7 @@ func NewPadded(objects ...fyne.CanvasObject) *fyne.Container { | |||
|
|||
// NewStack returns a new container that stacks objects on top of each other. | |||
// Objects at the end of the container will be stacked on top of objects before. | |||
// A stack with a single object does not change the size or position of that object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't seem right - it will resize it after all. It's more accurate to say that it doesn't provide any advantage as that is the default behaviour?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, you're right. I meant that it wouldn't change the size. I didn't know how to word that in a good way. Will have to think a bit more about it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just "A stack with a single object is a no-op" similar to the message you added to the layout itself?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wanted something more descriptive for the more commonly used container but maybe that was just a simple case of overthinking :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe along the lines of "having only a single item has no impact as widgets will fill available space without Stack"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds perfect. Thanks :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice
Description:
This adds a note to the documentation for stacklayout (and the corresponding container) that a single object has no effect on that object.
Checklist: