Function kas::layout::solve_size_rules
source · pub fn solve_size_rules<W>(
widget: &mut W,
sizer: SizeCx<'_>,
x_size: Option<i32>,
y_size: Option<i32>,
h_align: Option<Align>,
v_align: Option<Align>
)
Expand description
Solve size rules for a widget
Automatic layout solving requires that a widget’s size_rules
method is
called for each axis before set_rect
. This method simply calls
size_rules
on each axis.
If size_rules
is not called, internal layout may be poor (depending on the
widget). If widget content changes, it is recommended to call
solve_size_rules
and set_rect
again.
Parameters x_size
and y_size
should be passed where this dimension is
fixed and are used e.g. for text wrapping.