refactor: use theme corner_radii

This commit is contained in:
Ashley Wulber 2023-12-13 13:41:39 -05:00 committed by Ashley Wulber
parent feb8075d2c
commit 3de4b99e66
6 changed files with 99 additions and 86 deletions

View file

@ -5,24 +5,30 @@ use cosmic::{iced_widget::core::BorderRadius, theme};
#[must_use]
pub fn display_container_frame() -> cosmic::theme::Container {
theme::Container::custom(|_theme| cosmic::widget::container::Appearance {
icon_color: None,
text_color: None,
background: Some(cosmic::iced::Background::Color(cosmic::iced::Color::WHITE)),
border_color: cosmic::iced::Color::WHITE,
border_radius: BorderRadius::from(4.0),
border_width: 3.0,
theme::Container::custom(|theme| {
let cosmic = theme.cosmic();
cosmic::widget::container::Appearance {
icon_color: None,
text_color: None,
background: Some(cosmic::iced::Background::Color(cosmic::iced::Color::WHITE)),
border_color: cosmic::iced::Color::WHITE,
border_radius: cosmic.corner_radii.radius_xs.into(),
border_width: 3.0,
}
})
}
#[must_use]
pub fn display_container_screen() -> cosmic::theme::Container {
theme::Container::custom(|_theme| cosmic::widget::container::Appearance {
icon_color: None,
text_color: None,
background: Some(cosmic::iced::Background::Color(cosmic::iced::Color::BLACK)),
border_color: cosmic::iced::Color::BLACK,
border_radius: BorderRadius::from(0.0),
border_width: 0.0,
theme::Container::custom(|theme| {
let cosmic = theme.cosmic();
cosmic::widget::container::Appearance {
icon_color: None,
text_color: None,
background: Some(cosmic::iced::Background::Color(cosmic::iced::Color::BLACK)),
border_color: cosmic::iced::Color::BLACK,
border_radius: cosmic.corner_radii.radius_0.into(),
border_width: 0.0,
}
})
}