ZIm/crates/ui/src
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
..
components gpui: Support hitbox blocking mouse interaction except scrolling (#31712) 2025-05-29 21:41:15 +00:00
styles Add initial element inspector for Zed development (#31315) 2025-05-23 23:08:59 +00:00
traits Add a live Rust style editor to inspector to edit a sequence of no-argument style modifiers (#31443) 2025-05-26 17:43:57 +00:00
utils Add initial element inspector for Zed development (#31315) 2025-05-23 23:08:59 +00:00
component_prelude.rs component: Component crate cleanup (#29967) 2025-05-06 03:41:52 +00:00
components.rs agent: Add UI for upsell scenarios (#29805) 2025-05-05 00:48:06 +00:00
prelude.rs Merge Component and ComponentPreview trait (#28365) 2025-04-08 16:09:06 -06:00
styles.rs Add StatusToast & the ToastLayer (#26232) 2025-03-06 20:37:54 +00:00
traits.rs component: Add component and component_preview crates to power UI components (#24456) 2025-02-09 13:25:03 -05:00
ui.rs ui_macros: Remove DerivePathStr macro (#30862) 2025-05-17 10:05:55 +00:00
utils.rs welcome: Theme preview tile (#29689) 2025-04-30 17:46:11 +00:00