a lot of work on sliders

This commit is contained in:
Alessandro Mauri 2024-12-18 14:58:40 +01:00
parent c0e9565bf6
commit 8d4b353e88
9 changed files with 200 additions and 166 deletions

View file

@ -85,26 +85,24 @@ fn void! Ctx.frame_begin(&ctx)
// other stuff
c_elem.flags.has_focus = ctx.has_focus;
if (c_elem.flags.is_new || c_elem.flags.updated) {
Elem def_root = {
.id = ROOT_ID,
.type = ETYPE_DIV,
.bounds = {
Elem def_root = {
.id = ROOT_ID,
.type = ETYPE_DIV,
.bounds = {
.w = ctx.width,
.h = ctx.height,
},
.div = {
.layout = LAYOUT_ROW,
.children_bounds = {
.w = ctx.width,
.h = ctx.height,
},
.div = {
.layout = LAYOUT_ROW,
.children_bounds = {
.w = ctx.width,
.h = ctx.height,
}
},
.flags = c_elem.flags,
};
}
},
.flags = c_elem.flags,
};
*c_elem = def_root;
}
*c_elem = def_root;
// 3. Push the root element into the element tree
ctx.active_div = ctx.tree.add(ROOT_ID, 0)!;