feat(button): add ListItem style
This commit is contained in:
parent
43e7213b70
commit
a02fa21d36
1 changed files with 16 additions and 0 deletions
|
|
@ -27,6 +27,7 @@ pub enum Button {
|
|||
IconVertical,
|
||||
Image,
|
||||
Link,
|
||||
ListItem,
|
||||
MenuFolder,
|
||||
MenuItem,
|
||||
MenuRoot,
|
||||
|
|
@ -137,6 +138,21 @@ pub fn appearance(
|
|||
appearance.text_color = Some(component.on.into());
|
||||
corner_radii = &cosmic.corner_radii.radius_s;
|
||||
}
|
||||
Button::ListItem => {
|
||||
corner_radii = &[0.0; 4];
|
||||
let (background, text, icon) = color(&cosmic.background.component);
|
||||
|
||||
if selected {
|
||||
appearance.background =
|
||||
Some(Background::Color(cosmic.primary.component.hover.into()));
|
||||
appearance.icon_color = Some(cosmic.accent.base.into());
|
||||
appearance.text_color = Some(cosmic.accent.base.into());
|
||||
} else {
|
||||
appearance.background = Some(Background::Color(background));
|
||||
appearance.icon_color = icon;
|
||||
appearance.text_color = text;
|
||||
}
|
||||
}
|
||||
Button::MenuItem => {
|
||||
let (background, text, icon) = color(&cosmic.background.component);
|
||||
appearance.background = Some(Background::Color(background));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue