Skip to content
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

Merged
merged 2 commits into from
Aug 16, 2023

Conversation

Jacalz
Copy link
Member

@Jacalz Jacalz commented Aug 15, 2023

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:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

@coveralls
Copy link

Coverage Status

coverage: 65.26% (+0.01%) from 65.246% when pulling f91625e on Jacalz:stacklayout-single into d225e4e on fyne-io:develop.

Copy link
Member

@andydotxyz andydotxyz left a 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

@@ -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.
Copy link
Member

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?

Copy link
Member Author

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.

Copy link
Contributor

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?

Copy link
Member Author

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 :)

Copy link
Member

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"?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds perfect. Thanks :)

@Jacalz Jacalz requested a review from andydotxyz August 16, 2023 08:19
Copy link
Member

@andydotxyz andydotxyz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@Jacalz Jacalz merged commit 580211a into fyne-io:develop Aug 16, 2023
11 checks passed
@Jacalz Jacalz deleted the stacklayout-single branch August 16, 2023 20:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants