summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--native/src/widget/scrollable.rs4
-rw-r--r--style/src/scrollable.rs10
-rw-r--r--style/src/theme.rs17
3 files changed, 31 insertions, 0 deletions
diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs
index c1df8c39..b88b77e5 100644
--- a/native/src/widget/scrollable.rs
+++ b/native/src/widget/scrollable.rs
@@ -859,6 +859,8 @@ pub fn draw<Renderer>(
theme.dragging(style)
} else if mouse_over_y_scrollbar {
theme.hovered(style)
+ } else if mouse_over_scrollable {
+ theme.focused(style)
} else {
theme.active(style)
};
@@ -872,6 +874,8 @@ pub fn draw<Renderer>(
theme.dragging_horizontal(style)
} else if mouse_over_x_scrollbar {
theme.hovered_horizontal(style)
+ } else if mouse_over_scrollable {
+ theme.focused_horizontal(style)
} else {
theme.active_horizontal(style)
};
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 4ba4facf..1d262562 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.