Expand description
Layout utilities
For documentation of layout resolution, see the Layout
trait.
Size units are physical (real) pixels. This applies to most of KAS.
§Data types
SizeRules
is the “heart” of widget layout, used to specify a widget’s
size requirements. It provides various methods to compute derived rules
and SizeRules::solve_seq
, the “muscle” of the layout engine.
AxisInfo
, Margins
and Stretch
are auxilliary data types.
§Solvers
The RulesSolver
and RulesSetter
traits define interfaces for
layout engines:
SingleSolver
andSingleSetter
are trivial implementations for single-child parentsRowSolver
andRowSetter
set out a row or column of children. These are parametrised overS: RowStorage
allowing both efficient operation on a small fixed number of children withFixedRowStorage
and operation on a over aVec
withDynRowStorage
.GridSolver
andGridSetter
set out children assigned to grid cells with optional cell-spans. This is the most powerful and flexible layout engine.
RowPositionSolver
may be used with widgets set out by RowSetter
to quickly locate children from a coord
or rect
.
Structs§
- Align
Hints - Partial alignment information provided by the parent
- Align
Pair - Provides alignment information on both axes along with ideal size
- Axis
Info - Information on which axis is being resized
- DynGrid
Storage - Variable-length grid storage
- DynRow
Storage - Variable-length row storage
- Fixed
Grid Storage - Fixed-length grid storage
- Fixed
RowStorage - Fixed-length row storage
- Frame
Rules - Frame size rules
- Frame
Storage - Layout storage for frame
- Grid
Cell Info - Per-child information
- Grid
Dimensions - Grid dimensions
- Grid
Setter - A
RulesSetter
for grids supporting cell-spans - Grid
Solver - A
RulesSolver
for grids supporting cell-spans - Logical
Size - Logical (pre-scaling) pixel size
- Margins
- Margin sizes
- Pack
Storage - Layout storage for pack
- Pixmap
Scaling - Control over scaling
- RowPosition
Solver - Allows efficient implementations of
draw
/ event handlers based on the layout representation. - RowSetter
- A
RulesSetter
for rows (and, without loss of generality, for columns). - RowSolver
- A
RulesSolver
for rows (and, without loss of generality, for columns). - Single
Setter RulesSetter
implementation for a fixed single-child layout- Single
Solver RulesSolver
implementation for a fixed single-child layout- Size
Rules - Widget sizing information
- Solve
Cache - Size solver
- Visitor
- A layout visitor
Enums§
Traits§
- Default
With Len - Bound on
GridSolver
type parameters - Grid
Storage - Requirements of grid solver storage type
- Layout
Visitor - Macro-generated implementation of layout over a
Visitor
- RowStorage
- Requirements of row solver storage type
- RowTemp
- Temporary storage type.
- Rules
Setter - Resolves a
RulesSolver
solution for each child - Rules
Solver - A
SizeRules
solver for layouts - Visitable
- A sub-set of
Layout
used byVisitor
. - Visitable
List - A list of
Visitable
Functions§
- solve_
size_ rules - Solve size rules for a widget