gpui-component/crates
Jason Lee 4a3f520c5f
scrollbar: Manage ScrollbarState in Scrollbar internal. (#1690)
This PR to improve the Scrollbar API to manage the state in the
internal.

## Break Changes

Describe any breaking changes introduced by this pull request. If none,
remove this section.

- Removed `scrollbar_state` argument from `Scrollbar::new`,
`Scrollbar::both`, `Scrollbar::vertical` and `Scrollbar::horizontal`.

```diff
- Scrollbar::horizontal(&self.scrollbar_state, &self.scroll_handle)
+ Scrollbar::horizontal(&self.scroll_handle)

- Scrollbar::vertical(&self.scrollbar_state, &self.scroll_handle)
+ Scrollbar::vertical(&self.scroll_handle)
```

- Change `struct ScrollbarState` to private, we not need this not.

```diff
- pub struct ScrollbarState {
+ struct ScrollbarState {
```

- Renamed `trait ScrollHandleOffsetable` to `trait ScrollbarHanle`.

```diff
- pub trait ScrollHandleOffsetable {
+ pub trait ScrollbarHanle {
```

- Removed `Scrollbar::both`, now use `Scrollbar::new` instead.

```diff
- Scrollbar::both(&scroll_handle)
+ Scrollbar::new(&scroll_handle)
```
2025-11-27 11:39:58 +08:00
..
assets chore: Update to use Rust edition 2024. (#1669) 2025-11-24 14:38:43 +08:00
macros chore: Update to use Rust edition 2024. (#1669) 2025-11-24 14:38:43 +08:00
reqwest_client chore: Update to use Rust edition 2024. (#1669) 2025-11-24 14:38:43 +08:00
story scrollbar: Manage ScrollbarState in Scrollbar internal. (#1690) 2025-11-27 11:39:58 +08:00
ui scrollbar: Manage ScrollbarState in Scrollbar internal. (#1690) 2025-11-27 11:39:58 +08:00