summaryrefslogtreecommitdiffstats
path: root/style/src
diff options
context:
space:
mode:
Diffstat (limited to 'style/src')
-rw-r--r--style/src/scrollable.rs10
-rw-r--r--style/src/theme.rs17
2 files changed, 27 insertions, 0 deletions
diff --git a/style/src/scrollable.rs b/style/src/scrollable.rs
index 64ed8462..a3f3db20 100644
--- a/style/src/scrollable.rs
+++ b/style/src/scrollable.rs
@@ -45,6 +45,11 @@ pub trait StyleSheet {
self.hovered(style)
}
+ /// Produces the style of a scrollbar when mouse is over the scrollable area.
+ fn focused(&self, style: &Self::Style) -> Scrollbar {
+ self.active(style)
+ }
+
/// Produces the style of an active horizontal scrollbar.
fn active_horizontal(&self, style: &Self::Style) -> Scrollbar {
self.active(style)
@@ -59,4 +64,9 @@ pub trait StyleSheet {
fn dragging_horizontal(&self, style: &Self::Style) -> Scrollbar {
self.hovered_horizontal(style)
}
+
+ /// Produces the style of a horizontal scrollbar when mouse is over the scrollable area.
+ fn focused_horizontal(&self, style: &Self::Style) -> Scrollbar {
+ self.active_horizontal(style)
+ }
}
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.