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

Extended border radius on relevant widgets #1869

Merged
merged 3 commits into from
May 23, 2023

Conversation

casperstorm
Copy link
Member

This PR exposes the internal BorderRadius([f32; 4]) and replaces it with the current type (f32).
This means we now have the possibility to create buttons, containers and so on with different border radii.

Breaking changes
This is a breaking change, however to migrate to this new BorderRadius we have the following impl
So in most cases a simple .into() will solve it.

impl From<f32> for BorderRadius {
    fn from(w: f32) -> Self {
        Self([w; 4])
    }
}

impl From<[f32; 4]> for BorderRadius {
    fn from(radi: [f32; 4]) -> Self {
        Self(radi)
    }
}

@casperstorm casperstorm force-pushed the extend-border-radius branch from dd004cf to 6d7bafc Compare May 23, 2023 12:50
@casperstorm casperstorm force-pushed the extend-border-radius branch from 6d7bafc to 1c86def Compare May 23, 2023 12:51
Copy link
Contributor

@clarkmoody clarkmoody left a comment

Choose a reason for hiding this comment

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

ACK

examples/scrollable/src/main.rs Outdated Show resolved Hide resolved
@hecrj hecrj added this to the 0.10.0 milestone May 23, 2023
@hecrj hecrj added feature New feature or request styling labels May 23, 2023
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks 🎉

@hecrj hecrj merged commit 6c6930b into iced-rs:master May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request styling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants