added @row and @column macros

This commit is contained in:
Alessandro Mauri 2025-09-30 21:39:00 +02:00
parent d47b835020
commit 76cef2caa0

View File

@ -20,6 +20,21 @@ struct ElemDiv {
}
macro Ctx.@row(&ctx, Anchor anchor = TOP_LEFT, ...; @body())
{
ctx.@div(@fit(), @fit(), ROW, anchor: anchor) {
@body();
}!;
}
macro Ctx.@column(&ctx, Anchor anchor = TOP_LEFT, ...; @body())
{
ctx.@div(@fit(), @fit(), COLUMN, anchor: anchor) {
@body();
}!;
}
// useful macro to start and end a div, capturing the trailing block
macro Ctx.@div(&ctx,
Size width = @grow, Size height = @grow,