Expand description
The window’s measured size, and the registrations a runtime wakes its readers through.
The UI is authored here but measured by the Renderer, so the only way a Rust component
can know how wide the window is, is for the Renderer to tell it. The Renderer sends one
event when the size class changes and nothing in between, so this module is a single
current value plus the list of readers that asked to be told when it changes. The
Dioxus adapter’s use_window_size and use_node_size hooks are such readers.
Structs§
- Node
Size - A node whose measured size a reader follows.
- Node
Size Subscription - A registration for one node’s measured size, made with
subscribe_node. - Window
Safe Area - Insets in dp needed to avoid the window controls.
- Window
Size - The window’s size, as the Renderer last measured it.
- Window
Size Subscription - A registration for changes of the window’s size class. Dropping it ends the registration, so a runtime keeps it for as long as the reader it wakes is alive.
- Window
Subscription - A registration for one window’s size class. Dropping it ends the registration.
Functions§
- next_
node_ token - A fresh name for a node a screen wants measured. Never zero, which is the window’s.
- node_
size - The size a node last measured, or a zero size for one nothing has reported yet.
- subscribe
- Registers
notifyto be called each time the window’s measured size changes. Whatnotifydoes is the runtime’s business: mark a scope dirty, most often. - subscribe_
node - Registers
notifyto be called each time the node namedtokenreports a size in a different class. - subscribe_
window - Registers
notifyto be called each time the windowwindowmeasures a different size class. - window_
size - The size the Renderer last reported. Available outside a component too.
- window_
size_ of - The size a window last measured, by the id of its
Windownode, or the default for one nothing has reported yet.