macro_rules! row_layout {
($bounds:expr, $gravity:expr, $(padding: $padding:expr,)? $(spacing: $margin:expr,)? views: $($views:expr),+ $(,)?) => { ... };
}Expand description
Update the position multiple views to be in a row
if gravity is
- Top - then only the
top_leftofboundsis used - Center - then only the
centerofboundsis used - Bottom - then only the
bottom_rightofboundsis used
padding is used to offset views from the relevant position
spacing is space between views
Usage
ⓘ
let button1 = Button::new("Button", ...);
let button2 = Button::new("Button", ...);
let button3 = Button::new("Button", ...);
row_layout!(Rect::new((16,16),(16,16)), RowGravity::Top, spacing: 8, views: button3, button1, button2);
// button3 top left will be (16,16)
// button1 top left will be (16 + 8 + button3.width, 16)
// button2 top left will be (16 + 8 + 8 + button3.width + button1.width, 16)