Skip to main content

claiming_pane

Function claiming_pane 

Source
pub fn claiming_pane(
    id: impl Into<ElementId>,
    axes: Axes,
    window: &mut Window,
    cx: &mut App,
) -> Stateful<Div>
Expand description

pane, keeping the wheel it can act on: the pane a consumer nests inside another and never wires a handle to.

claim_wheel asks the caller for a ScrollHandle and a ClaimState, because the caller usually has the handle already — it is scrolling the pane from elsewhere. A bounded box inside someone else’s page has neither, and a pane that is only ever read by the wheel that moves it should not make a consumer hold two fields to stop it dragging the page behind it. Both live in keyed element state here, so the pane is still one call.

scroll::claiming_pane("output", Axes::Vertical, window, cx).child(text)

The chaining is claim_wheel’s: at its ends the pane hands the wheel back to the page.