Skip to main content

Module body_pane

Module body_pane 

Source
Expand description

BodyPane<T> — the virtualized row pane underneath the header.

Splitting this out of TableView’s root widget is a deliberate architectural choice: TableView owns three direct children — the header, the body pane, and the scrollbar. Rebuilds triggered by scroll-buffer exits, selection changes, or row-edit toggles target the body pane only, not the table root.

Why it matters: when the user drags the scrollbar thumb, the framework holds an implicit pointer capture on the scrollbar widget for the entire Down→Up sequence. The rebuild deferral in process_pending_rebuilds skips rebuilds that target any ancestor of the captured widget — otherwise the rebuild would destroy the scrollbar mid-drag and the recogniser would lose the press state. With the row-rebuild target moved off TableView (an ancestor of the scrollbar) and onto BodyPane (a sibling of the scrollbar), mid-drag rebuilds become safe and the body keeps materializing visible rows as scroll_y advances.

BodyPane is pub(crate) — applications still talk to TableView.