Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

scrollbar: Fix horizontal scrollbar display overflow last item (#19403)

CharlesChen0823f5124c21d1f6
diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs
index 121238b7d3d..a7ec02c06c0 100644
--- a/crates/project_panel/src/project_panel.rs
+++ b/crates/project_panel/src/project_panel.rs
@@ -2701,7 +2701,6 @@ impl ProjectPanel {
.cursor_default()
.when(self.width.is_some(), |this| {
this.children(Scrollbar::horizontal(
- //percentage as f32..end_offset as f32,
self.horizontal_scrollbar_state.clone(),
))
}),
@@ -2918,7 +2917,9 @@ impl Render for ProjectPanel {
.track_scroll(self.scroll_handle.clone()),
)
.children(self.render_vertical_scrollbar(cx))
- .children(self.render_horizontal_scrollbar(cx))
+ .when_some(self.render_horizontal_scrollbar(cx), |this, scrollbar| {
+ this.pb_4().child(scrollbar)
+ })
.children(self.context_menu.as_ref().map(|(menu, position, _)| {
deferred(
anchored()