Skip to main content

tilo_ui_graph/
layout.rs

1//! The width classes a view's container is laid out in (layout.md, "Responding to space").
2//!
3//! One token, read by the toolkit's layout (`ui::widget::WidthClass`) and by a
4//! tilolang app's `space`: a window is compact, medium, expanded or wide by the same widths in
5//! both, so what an app reads and what the shell lays out agree on when a window is compact.
6
7/// The width, in `rem`, below which a container is compact.
8pub const COMPACT_BELOW: f32 = 30.0;
9/// The width, in `rem`, below which a container is medium.
10pub const MEDIUM_BELOW: f32 = 52.0;
11/// The width, in `rem`, below which a container is expanded.
12pub const EXPANDED_BELOW: f32 = 75.0;
13/// How far past a boundary a size has to go before its class changes, in `rem`: a window
14/// resized right at a boundary keeps one class instead of flickering between two.
15pub const HYSTERESIS: f32 = 0.5;