ZIm/crates/ui/src/components
Michael Sloan 9086784038
gpui: Support hitbox blocking mouse interaction except scrolling (#31712)
tl;dr: This adds `.block_mouse_except_scroll()` which should typically
be used instead of `.occlude()` for cases when the mouse shouldn't
interact with elements drawn below an element. The rationale for
treating scroll events differently:

* Mouse move / click / styles / tooltips are for elements the user is
interacting with directly.
* Mouse scroll events are about finding the current outer scroll
container.

Most use of `occlude` should probably be switched to this, but I figured
I'd derisk this change by minimizing behavior changes to just the 3 uses
of `block_mouse_except_scroll`.

GPUI changes:

* Added `InteractiveElement::block_mouse_except_scroll()`, and removes
`stop_mouse_events_except_scroll()`

* Added `Hitbox::should_handle_scroll()` to be used when handling scroll
wheel events.

* `Window::insert_hitbox` now takes `HitboxBehavior` instead of
`occlude: bool`.

    - `false` for that bool is now `HitboxBehavior::Normal`.

    - `true` for that bool is now `HitboxBehavior::BlockMouse`.
    
    - The new mode is `HitboxBehavior::BlockMouseExceptScroll`.

* Removes `Default` impl for `HitboxId` since applications should not
manually create `HitboxId(0)`.

Release Notes:

- N/A
2025-05-29 21:41:15 +00:00
..
button Add initial element inspector for Zed development (#31315) 2025-05-23 23:08:59 +00:00
icon ui: Remove usage of DerivePathStr macro (#30861) 2025-05-17 09:05:58 +00:00
label ui: Add inline_code method to label (#29306) 2025-04-23 19:27:56 -03:00
list agent: Show delete thread icon buttons on hover/focus (#30370) 2025-05-09 12:55:40 -03:00
notification component: Component crate cleanup (#29967) 2025-05-06 03:41:52 +00:00
progress Add initial element inspector for Zed development (#31315) 2025-05-23 23:08:59 +00:00
stories Add Code Actions to the Toolbar (#31236) 2025-05-23 16:55:29 +05:30
avatar.rs Refine component preview & add serialization (#28545) 2025-04-11 11:43:57 -04:00
banner.rs agent: Improve consecutive tool call UX and rebrand Max Mode (#31470) 2025-05-27 19:44:10 -03:00
button.rs debugger: First slight pass at UI (#27034) 2025-03-19 00:15:48 +00:00
callout.rs ui: Make Callout constructors more flexible (#29895) 2025-05-05 01:18:48 +00:00
content_group.rs Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
context_menu.rs debugger: Add actions and keybindings for opening the thread and session menus (#31135) 2025-05-21 20:56:39 -04:00
disclosure.rs agent: Adjust MCP section in the settings view (#28615) 2025-04-11 21:39:57 -03:00
divider.rs Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
dropdown_menu.rs debugger: Add actions and keybindings for opening the thread and session menus (#31135) 2025-05-21 20:56:39 -04:00
facepile.rs Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
group.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
icon.rs Add progress bar component (#28518) 2025-04-10 12:11:58 -06:00
image.rs ui: Remove usage of DerivePathStr macro (#30861) 2025-05-17 09:05:58 +00:00
indent_guides.rs gpui: Support hitbox blocking mouse interaction except scrolling (#31712) 2025-05-29 21:41:15 +00:00
indicator.rs Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
keybinding.rs Don't display MacOS key symbols in Linux (#29016) 2025-04-17 21:48:00 -03:00
keybinding_hint.rs Add initial element inspector for Zed development (#31315) 2025-05-23 23:08:59 +00:00
label.rs chore: Revert changes made to ui crate structure (#17516) 2024-09-06 21:38:56 +02:00
list.rs chore: Revert changes made to ui crate structure (#17516) 2024-09-06 21:38:56 +02:00
modal.rs Reduce allocations (#30693) 2025-05-14 18:29:28 +02:00
navigable.rs agent: Refresh the profile selector and modal design (#29816) 2025-05-02 20:34:36 -03:00
notification.rs Add StatusToast & the ToastLayer (#26232) 2025-03-06 20:37:54 +00:00
numeric_stepper.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
popover.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
popover_menu.rs gpui: Support hitbox blocking mouse interaction except scrolling (#31712) 2025-05-29 21:41:15 +00:00
progress.rs Add progress bar component (#28518) 2025-04-10 12:11:58 -06:00
radio.rs ui: More component previews, UI component cleanup (#25302) 2025-02-21 09:20:53 -05:00
right_click_menu.rs gpui: Support hitbox blocking mouse interaction except scrolling (#31712) 2025-05-29 21:41:15 +00:00
scrollbar.rs gpui: Support hitbox blocking mouse interaction except scrolling (#31712) 2025-05-29 21:41:15 +00:00
settings_container.rs Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
settings_group.rs Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
stack.rs chore: Bump Rust edition to 2024 (#27800) 2025-03-31 20:55:27 +02:00
stories.rs Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
tab.rs ui: Fix content shift when selecting last tab (#31266) 2025-05-24 23:36:51 +03:00
tab_bar.rs Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
table.rs Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
toggle.rs ui: Add .color method to the Switch (#29074) 2025-04-21 10:56:42 -03:00
tooltip.rs agent: Add websearch tool (#28621) 2025-04-16 19:25:00 +02:00