gpui-component/crates
Jason Lee 118a0f500e
scrollbar: Introduce overflow_scrollbar to adds Scrollbars to elements. (#1694)
## Description

1. Add `overflow_scrollbar`, `overflow_y_scrollbar`, `overflow_x_scroll`
to GPUI elements to let them has scrollbars. It is almost like the
`overscroll` but adds the Scrollbar.
2. And adjust the display scrollbar of margining 4px of the container.
3. Add `scrollbar`, `vertical_scrollbar`, `horizontal_scrollbar` with
your own scroll handle.

<img width="1181" height="911" alt="image"
src="https://github.com/user-attachments/assets/8b02cd54-d527-4f22-b9be-f762ede22122"
/>

## Break Changes

- There `Scrollable` trait and it `scrollable` method has been removed.

```diff
- div().id("contents").scrollable(Axis::Vertical)
+ div().id("contents").overflow_y_scrollbar()
```
2025-11-27 11:29:50 +00:00
..
assets Bump v0.5.0-preview0 2025-11-27 14:49:36 +08:00
macros Bump v0.5.0-preview0 2025-11-27 14:49:36 +08:00
reqwest_client Bump v0.5.0-preview0 2025-11-27 14:49:36 +08:00
story scrollbar: Introduce overflow_scrollbar to adds Scrollbars to elements. (#1694) 2025-11-27 11:29:50 +00:00
ui scrollbar: Introduce overflow_scrollbar to adds Scrollbars to elements. (#1694) 2025-11-27 11:29:50 +00:00