pub struct RectRefresh { /* private fields */ }Expand description
A payload-type-erased “re-measure your zones” channel, shared by every registry under one provider tree.
Cached client rects go stale the moment layout moves under a live drag - scrolling being the everyday case. Registries are per payload type, but the things that move layout (an auto-scrolling container, your own scroll surface, a collapsing panel) shouldn’t need to know any payload type to say “geometry changed”. Each provider registers a thunk here that re-measures its own registry only while it has a drag in flight, so pinging the channel from every scroll event costs nothing while idle.
crate::autoscroll::AutoScroll pings this automatically after every
scroll it performs (and on any other scroll of its container); grab the
channel with crate::core::hooks::use_rect_refresh to wire up custom
layout mutators.
Implementations§
Source§impl RectRefresh
impl RectRefresh
Sourcepub fn from_signal(thunks: Signal<Vec<(u64, Callback<()>)>>) -> Self
pub fn from_signal(thunks: Signal<Vec<(u64, Callback<()>)>>) -> Self
Wrap an existing signal. Prefer crate::core::hooks::use_dnd_provider,
which creates one per provider tree (nested providers inherit and
re-provide the outermost channel).
Sourcepub fn refresh_all(&self)
pub fn refresh_all(&self)
Ask every provider in the tree to re-measure its zones. Providers without a drag in flight ignore the ping, so this is safe to call from high-frequency sources like scroll events.