Skip to content

Extended border radius on relevant widgets#1869

Merged
hecrj merged 3 commits intoiced-rs:masterfrom
casperstorm:extend-border-radius
May 23, 2023
Merged

Extended border radius on relevant widgets#1869
hecrj merged 3 commits intoiced-rs:masterfrom
casperstorm:extend-border-radius

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

@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

Comments