Introduce is_mouse_over_scrollbar to StyleSheet::hovered for Scrollable

This commit is contained in:
Héctor Ramón Jiménez 2023-03-27 15:51:32 +02:00
parent c337bf297d
commit c407b4504c
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
4 changed files with 74 additions and 67 deletions

View file

@ -857,10 +857,8 @@ pub fn draw<Renderer>(
if let Some(scrollbar) = scrollbars.y {
let style = if state.y_scroller_grabbed_at.is_some() {
theme.dragging(style)
} else if mouse_over_y_scrollbar {
theme.hovered_scrollbar(style)
} else if mouse_over_scrollable {
theme.hovered(style)
theme.hovered(style, mouse_over_y_scrollbar)
} else {
theme.active(style)
};
@ -872,10 +870,8 @@ pub fn draw<Renderer>(
if let Some(scrollbar) = scrollbars.x {
let style = if state.x_scroller_grabbed_at.is_some() {
theme.dragging_horizontal(style)
} else if mouse_over_x_scrollbar {
theme.hovered_scrollbar_horizontal(style)
} else if mouse_over_scrollable {
theme.hovered_horizontal(style)
theme.hovered_horizontal(style, mouse_over_x_scrollbar)
} else {
theme.active_horizontal(style)
};