Expand description
Which way the interface reads, and the logical styling that follows.
GPUI has no notion of a reading direction: Styled exposes pl/pr,
ml/mr, border_l/border_r and a TextAlign of Left, Center and
Right, all of them physical, and taffy’s logical properties are not
surfaced. So the direction is a global here, reaching components the same
way Theme does: a host sets it once, components
read it during render, and nothing is threaded through a builder argument.
The vocabulary is start and end rather than left and right. Start is where reading begins, so it is the left edge in a left-to-right interface and the right edge in a right-to-left one. Anything that is genuinely physical — the edge a vertical scrollbar sits on, the axis of a chart — keeps saying left and right, because those do not move when the reading direction does.
Enums§
- Layout
Direction - The direction the interface reads in.
- Logical
Side - An edge named by reading order rather than by geometry.
- Physical
Side - An edge that does not move when the reading direction does.
Traits§
- Active
Direction - Reads the active reading direction from any context that dereferences to
App, the wayActiveThemereads the theme. - Directional
Ext - Logical box model helpers, named by reading order.
Functions§
- install
- Installs the direction global at its default. Idempotent.
- set_
layout_ direction - Sets the reading direction and repaints every window.