added new style for scrollable, to be applied when mouse is over the scrollable area

This commit is contained in:
Giuliano Bellini s294739 2023-01-23 16:57:24 +01:00
parent eb4fcba05f
commit 7d2d813343
2 changed files with 14 additions and 0 deletions

View file

@ -856,6 +856,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)
};
@ -869,6 +871,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)
};

View file

@ -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)
}
}