added svg hover, for styles impl
This commit is contained in:
parent
dd249a1d11
commit
b54f27d30d
3 changed files with 18 additions and 2 deletions
|
|
@ -20,4 +20,7 @@ pub trait StyleSheet {
|
|||
|
||||
/// Produces the [`Appearance`] of the svg.
|
||||
fn appearance(&self, style: &Self::Style) -> Appearance;
|
||||
|
||||
/// Produces the hovered [`Appearance`] of a svg content.
|
||||
fn hovered(&self, style: &Self::Style) -> Appearance;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -909,6 +909,10 @@ impl svg::StyleSheet for Theme {
|
|||
Svg::Custom(custom) => custom.appearance(self),
|
||||
}
|
||||
}
|
||||
|
||||
fn hovered(&self, style: &Self::Style) -> svg::Appearance {
|
||||
self.appearance(style)
|
||||
}
|
||||
}
|
||||
|
||||
impl svg::StyleSheet for fn(&Theme) -> svg::Appearance {
|
||||
|
|
@ -917,6 +921,10 @@ impl svg::StyleSheet for fn(&Theme) -> svg::Appearance {
|
|||
fn appearance(&self, style: &Self::Style) -> svg::Appearance {
|
||||
(self)(style)
|
||||
}
|
||||
|
||||
fn hovered(&self, style: &Self::Style) -> svg::Appearance {
|
||||
self.appearance(style)
|
||||
}
|
||||
}
|
||||
|
||||
/// The style of a scrollable.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue