fix(style): use radius_s for nav bar toggle

This commit is contained in:
Vukašin Vojinović 2024-12-05 21:16:10 +01:00 committed by Michael Murphy
parent 75a11b3c84
commit 2d06ec4226
5 changed files with 35 additions and 27 deletions

View file

@ -14,13 +14,13 @@ use crate::{
#[derive(Default)]
pub enum Button {
AppletIcon,
AppletMenu,
Custom {
active: Box<dyn Fn(bool, &crate::Theme) -> Style>,
disabled: Box<dyn Fn(&crate::Theme) -> Style>,
hovered: Box<dyn Fn(bool, &crate::Theme) -> Style>,
pressed: Box<dyn Fn(bool, &crate::Theme) -> Style>,
},
AppletMenu,
Destructive,
HeaderBar,
Icon,
@ -31,6 +31,7 @@ pub enum Button {
MenuFolder,
MenuItem,
MenuRoot,
NavToggle,
#[default]
Standard,
Suggested,
@ -73,7 +74,7 @@ pub fn appearance(
}
}
Button::Icon | Button::IconVertical | Button::HeaderBar => {
Button::Icon | Button::IconVertical | Button::HeaderBar | Button::NavToggle => {
if matches!(style, Button::IconVertical) {
corner_radii = &cosmic.corner_radii.radius_m;
if selected {
@ -82,6 +83,9 @@ pub fn appearance(
)));
}
}
if matches!(style, Button::NavToggle) {
corner_radii = &cosmic.corner_radii.radius_s;
}
let (background, text, icon) = color(&cosmic.icon_button);
appearance.background = Some(Background::Color(background));

View file

@ -528,17 +528,7 @@ impl iced_container::Catalog for Theme {
}
}
Container::ContextDrawer => {
let mut appearance = Container::primary(cosmic);
appearance.shadow = Shadow {
color: cosmic.shade.into(),
offset: Vector::new(0.0, 0.0),
blur_radius: 16.0,
};
appearance
}
Container::ContextDrawer => Container::primary(cosmic),
Container::Background => Container::background(cosmic),