Skip to content

Commit

Permalink
Restore horizontal scrollbar checks (zed-industries#19767)
Browse files Browse the repository at this point in the history
Closes zed-industries#19637

Follow-up of zed-industries#18927 , restores
the condition that removed the horizontal scrollbar when panel's items
are not long enough.

Release Notes:

- Fixed horizontal scrollbar not being hidden
([zed-industries#19637](zed-industries#19637))
  • Loading branch information
SomeoneToIgnore authored Oct 26, 2024
1 parent 03a1c8d commit 2e32f1c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/project_panel/src/project_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2821,6 +2821,17 @@ impl ProjectPanel {
return None;
}

let scroll_handle = self.scroll_handle.0.borrow();
let longest_item_width = scroll_handle
.last_item_size
.filter(|size| size.contents.width > size.item.width)?
.contents
.width
.0 as f64;
if longest_item_width < scroll_handle.base_handle.bounds().size.width.0 as f64 {
return None;
}

Some(
div()
.occlude()
Expand Down

0 comments on commit 2e32f1c

Please sign in to comment.