summaryrefslogtreecommitdiff
path: root/crates/material_theme/src/radio.rs
diff options
context:
space:
mode:
authorpml68 <contact@pml68.dev>2025-04-28 10:56:49 +0200
committerpml68 <contact@pml68.dev>2025-04-28 10:56:49 +0200
commitdac7e82e0bff128097653fe05829b2d576fcdb2f (patch)
tree6f36736e79eecd6904933c6876af1df58e6b605b /crates/material_theme/src/radio.rs
parentfeat(material_theme): implement `image::Catalog` (under feature flag) (diff)
downloadiced-builder-dac7e82e0bff128097653fe05829b2d576fcdb2f.tar.gz
refactor(material_theme)!: make `Theme` an enum with `Custom` variant
Diffstat (limited to 'crates/material_theme/src/radio.rs')
-rw-r--r--crates/material_theme/src/radio.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/crates/material_theme/src/radio.rs b/crates/material_theme/src/radio.rs
index d249413..7fb7a3f 100644
--- a/crates/material_theme/src/radio.rs
+++ b/crates/material_theme/src/radio.rs
@@ -2,7 +2,7 @@ use iced_widget::core::{Background, Color};
use iced_widget::radio::{Catalog, Status, Style, StyleFn};
use super::Theme;
-use crate::utils::{DISABLED_TEXT_OPACITY, HOVERED_LAYER_OPACITY, mix};
+use crate::utils::{HOVERED_LAYER_OPACITY, disabled_text, mix};
impl Catalog for Theme {
type Class<'a> = StyleFn<'a, Self>;
@@ -17,8 +17,8 @@ impl Catalog for Theme {
}
pub fn default(theme: &Theme, status: Status) -> Style {
- let surface = theme.colorscheme.surface;
- let primary = theme.colorscheme.primary;
+ let surface = theme.colors().surface;
+ let primary = theme.colors().primary;
let active = Style {
background: Color::TRANSPARENT.into(),
@@ -46,10 +46,7 @@ pub fn default(theme: &Theme, status: Status) -> Style {
border_color: if is_selected {
mix(primary.color, surface.on_surface, HOVERED_LAYER_OPACITY)
} else {
- Color {
- a: DISABLED_TEXT_OPACITY,
- ..surface.on_surface
- }
+ disabled_text(surface.on_surface)
},
background: Background::Color(if is_selected {
Color {