Module layout

Module layout 

Source
Expand description

Layout utilities for screen positioning, responsive design, and layout computation.

This module provides:

  • ScreenLayout - Tools for computing screen locations from view coordinates
  • responsive - Responsive design breakpoints and size flags
  • LayoutCx - Context for computing Taffy layout nodes
  • ComputeLayoutCx - Context for computing view positions after Taffy layout

Re-exports§

pub use responsive::GridBreakpoints;
pub use responsive::ScreenSize;
pub use responsive::range;

Modules§

responsive

Structs§

ComputeLayoutCx
Context for computing view layout after Taffy has calculated sizes.
LayoutCx
Holds current layout state for given position in the tree. You’ll use this in the View::layout implementation to call layout_node on children and to access any font
ScreenLayout
A ScreenLayout is a snapshot of the layout of a view within a window

Functions§

screen_layout_for_window
try_create_screen_layout
Create a ScreenLayout for a view. This can fail if the view or an ancestor of it has no parent and is not realized on-screen, or if the platform does not support reading window inner or outer bounds. ScreenLayout is useful when needing to convert locations within a view into absolute positions on-screen, such as for creating a window at position relative to that view.