zed/assets
tims 8c92da45a9
terminal: Add scrollbar (#23256)
Closes #4798

This PR implements a scrollbar for the terminal by turning
`ScrollableHandle` into a trait, allowing us to implement a custom
scroll handle, `TerminalScrollHandle`. It works by converting terminal
lines into pixels that `ScrollableHandle` understands. When
`ScrollableHandle` provides a changed offset (e.g., when you drag the
scrollbar), we convert this pixel offset back into the number of lines
to scroll and update the terminal content accordingly.

While the current version works as expected, I believe the scrollbar's
offset updates could potentially be turned into an event. This event
could then be subscribed to in `TerminalView`, not needing to update the
terminal's offset in the `render` method as it might have performance
implications. Further ideas on this are welcome.

Preview:


https://github.com/user-attachments/assets/560f0aac-4544-4007-8f0b-8833386f608f

Todo:

- [x] Experiment with custom scrollbar responding to terminal mouse
scroll
- [x] Refactor existing scrollbar handle into a trait  
- [x] Update terminal to use the scrollbar trait instead of a custom
scrollbar implementation
- [x] Figure out how scrollbar events like mouse drag should notify the
terminal to update its state
- [x] Code clean up
- [x] Scrollbar hide setting for terminal

Release Notes:

- Added scrollbar to the terminal
2025-01-18 17:36:41 +01:00
..
fonts Fix font selection on macOS (#13615) 2024-06-27 17:02:45 -06:00
icons Refactor file icons to use IconTheme (#23153) 2025-01-14 22:49:36 +00:00
images add ui::Vector and separate images from icons (#17815) 2024-09-13 17:44:16 -04:00
keymaps assistant2: Thread history keyboard navigation (#23145) 2025-01-17 18:41:17 -03:00
prompts Update suggest_edits prompt to clarify usage of <old_text> when using update/create operations (#22341) 2025-01-08 23:45:15 +00:00
settings terminal: Add scrollbar (#23256) 2025-01-18 17:36:41 +01:00
sounds
themes Add hover_line_number color token (#23279) 2025-01-17 09:24:42 -03:00