summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Giuliano Bellini s294739 <s294739@studenti.polito.it>2023-01-23 17:56:39 +0100
committerLibravatar Giuliano Bellini s294739 <s294739@studenti.polito.it>2023-01-23 17:56:39 +0100
commit49e9a9a5379c1e9a9469045ca9a51ffb860ee620 (patch)
tree97588ad809e66aba01b0f936fcff21cb72ac6250
parenteaa2238600a0d3055b379592c7a3f8e6453b9dc7 (diff)
downloadiced-49e9a9a5379c1e9a9469045ca9a51ffb860ee620.tar.gz
iced-49e9a9a5379c1e9a9469045ca9a51ffb860ee620.tar.bz2
iced-49e9a9a5379c1e9a9469045ca9a51ffb860ee620.zip
added function focused and focused_horizontal to theme.rs
-rw-r--r--native/src/widget/scrollable.rs4
-rw-r--r--style/src/theme.rs17
2 files changed, 19 insertions, 2 deletions
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index 71814034..de6eacb5 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -859,7 +859,7 @@ pub fn draw<Renderer>(
} else if mouse_over_scrollable {
theme.focused(style)
} else {
- theme.focused(style)
+ theme.active(style)
};
draw_scrollbar(renderer, style, &scrollbar);
@@ -874,7 +874,7 @@ pub fn draw<Renderer>(
} else if mouse_over_scrollable {
theme.focused_horizontal(style)
} else {
- theme.focused_horizontal(style)
+ theme.active_horizontal(style)
};
draw_scrollbar(renderer, style, &scrollbar);
diff --git a/style/src/theme.rs b/style/src/theme.rs
index 55bfa4ca..8d40bda1 100644
--- a/style/src/theme.rs
+++ b/style/src/theme.rs
@@ -935,6 +935,13 @@ impl scrollable::StyleSheet for Theme {
}
}
+ fn focused(&self, style: &Self::Style) -> scrollable::Scrollbar {
+ match style {
+ Scrollable::Default => self.active(style),
+ Scrollable::Custom(custom) => custom.focused(self),
+ }
+ }
+
fn active_horizontal(&self, style: &Self::Style) -> scrollable::Scrollbar {
match style {
Scrollable::Default => self.active(style),
@@ -958,6 +965,16 @@ impl scrollable::StyleSheet for Theme {
Scrollable::Custom(custom) => custom.dragging_horizontal(self),
}
}
+
+ fn focused_horizontal(
+ &self,
+ style: &Self::Style,
+ ) -> scrollable::Scrollbar {
+ match style {
+ Scrollable::Default => self.active_horizontal(style),
+ Scrollable::Custom(custom) => custom.focused_horizontal(self),
+ }
+ }
}
/// The style of text.