scrollbar: Fix Scrollbar not clickable when it is always showing. (#686)

On `platform` level,
[should_auto_hide_scrollbars()](76a81607de/crates/gpui/src/platform.rs (L205))
might be `false` for some `platform`s, e.g. for `Linux`.

That's why another check is needed to make scrollbars work properly on
Linux.

Fixes #685

---------

Co-authored-by: Jason Lee <huacnlee@gmail.com>
This commit is contained in:
Jens Krause 2025-03-05 03:14:22 +01:00 committed by GitHub
parent c3f08d52b9
commit c06a0c5d78
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -632,7 +632,7 @@ impl Element for Scrollbar {
cx: &mut App,
) {
let hitbox_bounds = prepaint.hitbox.bounds;
let is_visible = self.state.get().is_scrollbar_visible();
let is_visible = self.state.get().is_scrollbar_visible() || cx.theme().scrollbar_show.is_always();
let is_hover_to_show = cx.theme().scrollbar_show.is_hover();
// Update last_scroll_time when offset is changed.