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

Replace Length with impl Into<Length> in width/height APIs #237

Merged

Conversation

TitouanReal
Copy link
Contributor

Widgets in iced allow to change their height and their width with an API like this :

pub fn width(mut self, width: impl Into<Length>) -> Self

This is especially useful when setting a fixed width/height:

my_widget.width(30);

instead of

my_widget.width(Length::Fixed(30.));

This PR proposes to change the API to make it more in line with the one in iced.

Copy link
Collaborator

@genusistimelord genusistimelord left a comment

Choose a reason for hiding this comment

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

thank you, this was still set to the old way of doing things.

@genusistimelord genusistimelord merged commit 898cf99 into iced-rs:main Apr 30, 2024
2 checks passed
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.

2 participants