diff --git a/crates/project_panel/src/project_panel.rs b/crates/project_panel/src/project_panel.rs index ce3a9863bb0..aef907ed9f1 100644 --- a/crates/project_panel/src/project_panel.rs +++ b/crates/project_panel/src/project_panel.rs @@ -62,7 +62,7 @@ use theme_settings::ThemeSettings; use ui::{ Color, ContextMenu, ContextMenuEntry, DecoratedIcon, Icon, IconDecoration, IconDecorationKind, IndentGuideColors, IndentGuideLayout, Indicator, KeyBinding, Label, LabelSize, ListItem, - ListItemSpacing, ProjectEmptyState, ScrollAxes, ScrollableHandle, Scrollbars, StickyCandidate, + ListItemSpacing, ProjectEmptyState, ScrollableHandle, Scrollbars, StickyCandidate, Tooltip, WithScrollbar, prelude::*, v_flex, }; use util::{ @@ -7087,15 +7087,9 @@ impl Render for ProjectPanel { ) .custom_scrollbars( { - let mut scrollbars = - Scrollbars::for_settings::() - .tracked_scroll_handle(&self.scroll_handle) - .with_overlay_track_along(ScrollAxes::Vertical); - if horizontal_scroll { - scrollbars = - scrollbars.with_overlay_track_along(ScrollAxes::Horizontal); - } - scrollbars.notify_content() + Scrollbars::for_settings::() + .tracked_scroll_handle(&self.scroll_handle) + .notify_content() }, window, cx, diff --git a/crates/settings_ui/src/settings_ui.rs b/crates/settings_ui/src/settings_ui.rs index e4e7f4ad4bf..02bbacdfa30 100644 --- a/crates/settings_ui/src/settings_ui.rs +++ b/crates/settings_ui/src/settings_ui.rs @@ -3477,19 +3477,12 @@ impl SettingsWindow { window.focus_prev(cx); })) .when(current_sub_page.is_none(), |this| { - this.custom_scrollbars( - Scrollbars::new(ui::ScrollAxes::Vertical) - .tracked_scroll_handle(&self.list_state) - .with_overlay_track_along(ui::ScrollAxes::Vertical), - window, - cx, - ) + this.vertical_scrollbar_for(&self.list_state, window, cx) }) .when_some(current_sub_page, |this, current_sub_page| { this.custom_scrollbars( Scrollbars::new(ui::ScrollAxes::Vertical) .tracked_scroll_handle(¤t_sub_page.scroll_handle) - .with_overlay_track_along(ui::ScrollAxes::Vertical) .id((current_sub_page.link.title.clone(), 42)), window, cx, diff --git a/crates/ui/src/components/scrollbar.rs b/crates/ui/src/components/scrollbar.rs index af29605f8e9..22bb47c6fd8 100644 --- a/crates/ui/src/components/scrollbar.rs +++ b/crates/ui/src/components/scrollbar.rs @@ -321,7 +321,6 @@ enum ReservedSpace { None, Thumb, Track, - OverlayTrack, StableTrack, } @@ -331,7 +330,7 @@ impl ReservedSpace { } fn needs_scroll_track(&self) -> bool { - matches!(self, Self::Track | Self::OverlayTrack | Self::StableTrack) + matches!(self, Self::Thumb | Self::Track | Self::StableTrack) } fn needs_space_reserved(&self, max_offset: Pixels) -> bool { @@ -474,11 +473,6 @@ impl Scrollbars { self } - pub fn with_overlay_track_along(mut self, along: ScrollAxes) -> Self { - self.visibility = along.apply_to(self.visibility, ReservedSpace::OverlayTrack); - self - } - pub fn with_stable_track_along(mut self, along: ScrollAxes, background_color: Hsla) -> Self { self.visibility = along.apply_to(self.visibility, ReservedSpace::StableTrack); self.track_color = Some(background_color);