scrollbar: Fix scroll to show mode. (#1381)
Close #1379, this bug is introduced from #1196.
This commit is contained in:
parent
429a4b2858
commit
491bacfd0e
1 changed files with 2 additions and 1 deletions
|
|
@ -579,6 +579,7 @@ impl Element for Scrollbar {
|
|||
|
||||
let state = self.state.clone();
|
||||
let is_always_to_show = cx.theme().scrollbar_show.is_always();
|
||||
let is_hover_to_show = cx.theme().scrollbar_show.is_hover();
|
||||
let is_hovered_on_bar = state.get().hovered_axis == Some(axis);
|
||||
let is_hovered_on_thumb = state.get().hovered_on_thumb == Some(axis);
|
||||
let is_offset_changed = state.get().last_scroll_offset != self.scroll_handle.offset();
|
||||
|
|
@ -586,7 +587,7 @@ impl Element for Scrollbar {
|
|||
let (thumb_bg, bar_bg, bar_border, thumb_width, inset, radius) =
|
||||
if state.get().dragged_axis == Some(axis) {
|
||||
Self::style_for_active(cx)
|
||||
} else if is_hovered_on_bar || is_hovered_on_thumb {
|
||||
} else if is_hover_to_show && (is_hovered_on_bar || is_hovered_on_thumb) {
|
||||
if is_hovered_on_thumb {
|
||||
Self::style_for_hovered_thumb(cx)
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue