summaryrefslogtreecommitdiffstats
path: root/style
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector@hecrj.dev>2024-01-18 03:46:13 +0100
committerLibravatar GitHub <noreply@github.com>2024-01-18 03:46:13 +0100
commit61e3d8502fec7e83c584218e598fa20c79363be3 (patch)
tree89dcd993beff331e5a92e00c9249e0413ee2e5f5 /style
parent070abff5cee7fd351185a7cbc38a54e1d5f0db70 (diff)
parentb083eda663b8939e1c3e86b5ce2cb5fa8fc80ccb (diff)
downloadiced-61e3d8502fec7e83c584218e598fa20c79363be3.tar.gz
iced-61e3d8502fec7e83c584218e598fa20c79363be3.tar.bz2
iced-61e3d8502fec7e83c584218e598fa20c79363be3.zip
Merge pull request #2163 from hicaru/svg_hover
added svg hover, for styles impl
Diffstat (limited to 'style')
-rw-r--r--style/src/svg.rs3
-rw-r--r--style/src/theme.rs8
2 files changed, 11 insertions, 0 deletions
diff --git a/style/src/svg.rs b/style/src/svg.rs
index 9378c1a7..5053f9f8 100644
--- a/style/src/svg.rs
+++ b/style/src/svg.rs
@@ -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;
}
diff --git a/style/src/theme.rs b/style/src/theme.rs
index deccf455..f78587e5 100644
--- a/style/src/theme.rs
+++ b/style/src/theme.rs
@@ -939,6 +939,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 {
@@ -947,6 +951,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.