add separator widget
This commit is contained in:
parent
6a13245fd9
commit
24216e4ab4
1 changed files with 16 additions and 0 deletions
16
lib/ugui.c3l/src/widgets/ugui_separator.c3
Normal file
16
lib/ugui.c3l/src/widgets/ugui_separator.c3
Normal file
|
|
@ -0,0 +1,16 @@
|
||||||
|
module ugui;
|
||||||
|
|
||||||
|
|
||||||
|
macro Ctx.separator(&ctx, int width, int height, ...)
|
||||||
|
=> ctx.separator_id(@compute_id($vasplat), width, height);
|
||||||
|
fn void? Ctx.separator_id(&ctx, Id id, int width, int height)
|
||||||
|
{
|
||||||
|
id = ctx.gen_id(id)!;
|
||||||
|
Elem *parent = ctx.get_parent()!;
|
||||||
|
Elem *elem = ctx.get_elem(id, ETYPE_NONE)!;
|
||||||
|
|
||||||
|
elem.layout.w = @exact((short)width);
|
||||||
|
elem.layout.h = @exact((short)height);
|
||||||
|
|
||||||
|
update_parent_size(elem, parent);
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue