pub trait MacroDefinedLayout {
// Required methods
fn rect(&self) -> Rect;
fn size_rules(&mut self, sizer: SizeCx<'_>, axis: AxisInfo) -> SizeRules;
fn set_rect(&mut self, cx: &mut ConfigCx<'_>, rect: Rect, hints: AlignHints);
fn try_probe(&self, coord: Coord) -> Option<Id>;
fn draw(&self, draw: DrawCx<'_>);
}
Expand description
Macro-defined layout
This trait is a copy of Layout
, implemented by the [#[layout]
] attribute.
This trait may prove useful to modify the layout code generated by
[#[layout]
] with additional code. For examples, see the RadioButton
and
SpinBox
widgets.
[#[layout]
]: kas::layout
Required Methods§
Sourcefn size_rules(&mut self, sizer: SizeCx<'_>, axis: AxisInfo) -> SizeRules
fn size_rules(&mut self, sizer: SizeCx<'_>, axis: AxisInfo) -> SizeRules
Get size rules for the given axis
Sourcefn set_rect(&mut self, cx: &mut ConfigCx<'_>, rect: Rect, hints: AlignHints)
fn set_rect(&mut self, cx: &mut ConfigCx<'_>, rect: Rect, hints: AlignHints)
Set size and position