Cosmic example: Add Tab navagation

This commit is contained in:
13r0ck 2023-01-05 11:29:14 -07:00 committed by Jeremy Soller
parent 1554a1ee03
commit 59edb3bbf1
3 changed files with 63 additions and 10 deletions

View file

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