scrollbar: Remove Scrollbar::uniform_scroll, use Scrollbar::vertical instead. (#1659)

## Break Change

- Remove `Scrollbar::uniform_scroll`, use `Scrollbar::vertical` instead.

```diff
- Scrollbar::uniform_scroll(&scroll_state, &scroll_handle)
+ Scrollbar::vertical(&scroll_state, &scroll_handle)
```
This commit is contained in:
Jason Lee 2025-11-21 22:53:33 +08:00 committed by GitHub
parent c523b3485b
commit 857f7973e3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 3 additions and 14 deletions

View file

@ -550,7 +550,7 @@ where
} }
}) })
.when(scrollbar_visible, |this| { .when(scrollbar_visible, |this| {
this.child(Scrollbar::uniform_scroll(&scroll_state, &scroll_handle)) this.child(Scrollbar::vertical(&scroll_state, &scroll_handle))
}) })
} }
} }

View file

@ -359,14 +359,6 @@ impl Scrollbar {
Self::new(ScrollbarAxis::Vertical, state, scroll_handle) Self::new(ScrollbarAxis::Vertical, state, scroll_handle)
} }
/// Create vertical scrollbar for uniform list.
pub fn uniform_scroll(
state: &ScrollbarState,
scroll_handle: &(impl ScrollHandleOffsetable + Clone + 'static),
) -> Self {
Self::new(ScrollbarAxis::Vertical, state, scroll_handle)
}
/// Set the scrollbar show mode [`ScrollbarShow`], if not set use the `cx.theme().scrollbar_show`. /// Set the scrollbar show mode [`ScrollbarShow`], if not set use the `cx.theme().scrollbar_show`.
pub fn scrollbar_show(mut self, scrollbar_show: ScrollbarShow) -> Self { pub fn scrollbar_show(mut self, scrollbar_show: ScrollbarShow) -> Self {
self.scrollbar_show = Some(scrollbar_show); self.scrollbar_show = Some(scrollbar_show);

View file

@ -1214,11 +1214,8 @@ where
.bottom_0() .bottom_0()
.w(Scrollbar::width()) .w(Scrollbar::width())
.child( .child(
Scrollbar::uniform_scroll( Scrollbar::vertical(&self.vertical_scroll_state, &self.vertical_scroll_handle)
&self.vertical_scroll_state, .max_fps(60),
&self.vertical_scroll_handle,
)
.max_fps(60),
), ),
) )
} }