diff options
| author | Polesznyák Márk <contact@pml68.dev> | 2026-02-03 23:59:14 +0100 |
|---|---|---|
| committer | Polesznyák Márk <contact@pml68.dev> | 2026-02-03 23:59:14 +0100 |
| commit | a60c7bb059f8ec2f84a43ec5501754a89980c604 (patch) | |
| tree | 1ee70f746f3796d85f82e60a43a6c15dd725229a | |
| parent | chore: bump MSRV to match iced's (diff) | |
| download | iced_material-a60c7bb059f8ec2f84a43ec5501754a89980c604.tar.gz | |
refactor: increase border radius of rounded widgets just in case
| -rw-r--r-- | examples/styling.rs | 3 | ||||
| -rw-r--r-- | src/button.rs | 8 | ||||
| -rw-r--r-- | src/progress_bar.rs | 2 | ||||
| -rw-r--r-- | src/scrollable.rs | 10 | ||||
| -rw-r--r-- | src/slider.rs | 2 |
5 files changed, 12 insertions, 13 deletions
diff --git a/examples/styling.rs b/examples/styling.rs index 81c82dd..6336da3 100644 --- a/examples/styling.rs +++ b/examples/styling.rs @@ -219,8 +219,7 @@ impl Styling { fn subscription(&self) -> Subscription<Message> { keyboard::listen().filter_map(|event| { - let keyboard::Event::KeyPressed { key, .. } = event - else { + let keyboard::Event::KeyPressed { key, .. } = event else { return None; }; diff --git a/src/button.rs b/src/button.rs index c4009c5..5fec1a8 100644 --- a/src/button.rs +++ b/src/button.rs @@ -31,7 +31,7 @@ pub fn styled( let active = Style { background: Some(Background::Color(background)), text_color: foreground, - border: border::rounded(400), + border: border::rounded(9999), shadow: shadow_from_elevation(elevation(elevation_level), shadow_color), snap: CRISP, }; @@ -61,7 +61,7 @@ pub fn styled( Status::Disabled => Style { background: Some(Background::Color(disabled_container(disabled))), text_color: disabled_text(disabled), - border: border::rounded(400), + border: border::rounded(9999), ..Default::default() }, } @@ -113,12 +113,12 @@ pub fn outlined(theme: &Theme, status: Status) -> Style { Status::Active | Status::Pressed | Status::Hovered => Border { color: outline, width: 1.0, - radius: 400.into(), + radius: 9999.into(), }, Status::Disabled => Border { color: disabled_container(disabled), width: 1.0, - radius: 400.into(), + radius: 9999.into(), }, }; diff --git a/src/progress_bar.rs b/src/progress_bar.rs index 5e079ff..8e99114 100644 --- a/src/progress_bar.rs +++ b/src/progress_bar.rs @@ -19,6 +19,6 @@ pub fn default(theme: &Theme) -> Style { Style { background: Background::Color(theme.colors().secondary.container), bar: Background::Color(theme.colors().primary.color), - border: border::rounded(400), + border: border::rounded(9999), } } diff --git a/src/scrollable.rs b/src/scrollable.rs index 5f3f166..46cbeb1 100644 --- a/src/scrollable.rs +++ b/src/scrollable.rs @@ -30,7 +30,7 @@ pub fn default(theme: &Theme, status: Status) -> Style { background: None, scroller: Scroller { background: surface.text.into(), - border: border::rounded(400), + border: border::rounded(9999), }, border: Border::default(), }; @@ -39,7 +39,7 @@ pub fn default(theme: &Theme, status: Status) -> Style { background: Some(Background::Color(disabled_container(surface.text))), scroller: Scroller { background: disabled_text(surface.text).into(), - border: border::rounded(400), + border: border::rounded(9999), }, ..active_rail }; @@ -53,7 +53,7 @@ pub fn default(theme: &Theme, status: Status) -> Style { let disabled_auto_scroll = AutoScroll { background: disabled_container(surface.text).into(), - border: border::rounded(400), + border: border::rounded(9999), icon: disabled_text(surface.text), shadow: Shadow::default(), }; @@ -104,7 +104,7 @@ pub fn default(theme: &Theme, status: Status) -> Style { HOVERED_LAYER_OPACITY, ) .into(), - border: border::rounded(400), + border: border::rounded(9999), }, ..active_rail }; @@ -148,7 +148,7 @@ pub fn default(theme: &Theme, status: Status) -> Style { PRESSED_LAYER_OPACITY, ) .into(), - border: border::rounded(400), + border: border::rounded(9999), }, ..active_rail }; diff --git a/src/slider.rs b/src/slider.rs index 2146acb..11639f2 100644 --- a/src/slider.rs +++ b/src/slider.rs @@ -27,7 +27,7 @@ pub fn styled(left: Color, right: Color, handle_radius: f32) -> Style { rail: Rail { backgrounds: (left.into(), right.into()), width: 8.0, - border: border::rounded(400), + border: border::rounded(9999), }, handle: Handle { shape: HandleShape::Circle { |
