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| {
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)
}
/// 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`.
pub fn scrollbar_show(mut self, scrollbar_show: ScrollbarShow) -> Self {
self.scrollbar_show = Some(scrollbar_show);

View file

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