Skip to main content

Module window

Module window 

Source
Expand description

The window’s measured size, and the hook components read it 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 components that asked to be told when it changes.

Structs§

NodeSize
Reads the window’s size class inside a component, and re-renders it when the class changes.
WindowSize
The window’s size, as the Renderer last measured it.

Functions§

node_size
The size a node last measured, or a zero size for one nothing has reported yet.
use_node_size
Follows one node’s size, and re-renders this component when its class changes.
use_window_size
window_size
The size the Renderer last reported. Available outside a component too.