feat: add focus style to button
This commit is contained in:
parent
eb0fcf5278
commit
ba41a48971
2 changed files with 16 additions and 17 deletions
|
|
@ -253,23 +253,22 @@ impl button::StyleSheet for Theme {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO add back
|
||||
// fn focused(&self, style: &Self::Style) -> button::Appearance {
|
||||
// if let Button::Custom { hover, .. } = style {
|
||||
// return hover(self);
|
||||
// }
|
||||
fn focused(&self, style: &Self::Style) -> button::Appearance {
|
||||
if let Button::Custom { hover, .. } = style {
|
||||
return hover(self);
|
||||
}
|
||||
|
||||
// let active = self.active(style);
|
||||
// let component = style.cosmic(self);
|
||||
// button::Appearance {
|
||||
// background: match style {
|
||||
// Button::Link => None,
|
||||
// Button::LinkActive => Some(Background::Color(component.divider.into())),
|
||||
// _ => Some(Background::Color(component.hover.into())),
|
||||
// },
|
||||
// ..active
|
||||
// }
|
||||
// }
|
||||
let active = self.active(style);
|
||||
let component = style.cosmic(self);
|
||||
button::Appearance {
|
||||
background: match style {
|
||||
Button::Link => None,
|
||||
Button::LinkActive => Some(Background::Color(component.divider.into())),
|
||||
_ => Some(Background::Color(component.hover.into())),
|
||||
},
|
||||
..active
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ impl<'a> IconSource<'a> {
|
|||
let handle = if let Some(path) = icon {
|
||||
svg::Handle::from_path(path)
|
||||
} else {
|
||||
eprintln!("svg icon '{:?}' size {} not found", self, size);
|
||||
eprintln!("svg icon '{self:?}' size {size} not found");
|
||||
svg::Handle::from_memory(Vec::new())
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue