feat: add focus style to button

This commit is contained in:
Ashley Wulber 2023-05-10 13:20:16 -04:00
parent eb0fcf5278
commit ba41a48971
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
2 changed files with 16 additions and 17 deletions

View file

@ -253,23 +253,22 @@ impl button::StyleSheet for Theme {
} }
} }
// TODO add back fn focused(&self, style: &Self::Style) -> button::Appearance {
// fn focused(&self, style: &Self::Style) -> button::Appearance { if let Button::Custom { hover, .. } = style {
// if let Button::Custom { hover, .. } = style { return hover(self);
// return hover(self); }
// }
// let active = self.active(style); let active = self.active(style);
// let component = style.cosmic(self); let component = style.cosmic(self);
// button::Appearance { button::Appearance {
// background: match style { background: match style {
// Button::Link => None, Button::Link => None,
// Button::LinkActive => Some(Background::Color(component.divider.into())), Button::LinkActive => Some(Background::Color(component.divider.into())),
// _ => Some(Background::Color(component.hover.into())), _ => Some(Background::Color(component.hover.into())),
// }, },
// ..active ..active
// } }
// } }
} }
/* /*

View file

@ -71,7 +71,7 @@ impl<'a> IconSource<'a> {
let handle = if let Some(path) = icon { let handle = if let Some(path) = icon {
svg::Handle::from_path(path) svg::Handle::from_path(path)
} else { } else {
eprintln!("svg icon '{:?}' size {} not found", self, size); eprintln!("svg icon '{self:?}' size {size} not found");
svg::Handle::from_memory(Vec::new()) svg::Handle::from_memory(Vec::new())
}; };