ui expander working!

This commit is contained in:
Krzosa Karol
2025-01-11 10:34:51 +01:00
parent fa3d59ed3e
commit 3acc1c2ca4
7 changed files with 194 additions and 107 deletions

View File

@@ -42,40 +42,37 @@ fn void app_init(void) {
fn b32 app_update(app_frame_t *frame) {
assert(frame != NULL);
ui_begin_frame(frame);
defer_block(ui_begin_build(), ui_end_build()) {
defer_block(ui_push_list_container(), ui_pop_parent()) {
defer_if (ui_push_expander("app_event_t"), ui_pop_expander()) {
if (r2f32_contains(r2f32(0, 0, 200, 200), frame->mouse_pos)) {
defer_if (ui_push_expander("mouse_wheel_delta: v3f64_t"), ui_pop_expander()) {
ui_label("x: f64 = value");
ui_label("y: f64 = value");
ui_label("z: f64 = value");
}
}
ui_label("kind: app_event_kind_t = value");
ui_label("ctrl: b8 = value");
ui_label("shift: b8 = value");
defer_if (ui_push_expander("pos: v2f64_t"), ui_pop_expander()) {
defer_if (ui_push_expander("inner_pos: v2f64_t"), ui_pop_expander()) {
ui_label("x_: f64 = value");
ui_label("y_: f64 = value");
}
ui_label("y__: f64 = value");
defer_if (ui_push_expander("_inner_pos: v2f64_t"), ui_pop_expander()) {
ui_label("x____: f64 = value");
ui_label("y____: f64 = value");
}
}
ui_label("alt: b8 = value");
ui_label("meta: b8 = value");
}
}
}
assert(frame->first_event);
for (app_event_t *ev = frame->first_event; ev; ev = ev->next) {
if (globals->event.kind == app_event_kind_null) {
globals->event = *ev;
defer_block(ui_begin_build(FILE_AND_LINE, ev), ui_end_build()) {
defer_block(ui_push_list_container(FILE_AND_LINE), ui_pop_parent()) {
defer_if (ui_push_expander(FILE_AND_LINE, "app_event_t").clicked, ui_pop_expander()) {
defer_if (ui_push_expander(FILE_AND_LINE, "mouse_wheel_delta: v3f64_t").clicked, ui_pop_expander()) {
ui_label(FILE_AND_LINE, "x: f64 = value");
ui_label(FILE_AND_LINE, "y: f64 = value");
ui_label(FILE_AND_LINE, "z: f64 = value");
}
ui_label(FILE_AND_LINE, "kind: app_event_kind_t = value");
ui_label(FILE_AND_LINE, "ctrl: b8 = value");
ui_label(FILE_AND_LINE, "shift: b8 = value");
defer_if (ui_push_expander(FILE_AND_LINE, "pos: v2f64_t").clicked, ui_pop_expander()) {
defer_if (ui_push_expander(FILE_AND_LINE, "inner_pos: v2f64_t").clicked, ui_pop_expander()) {
ui_label(FILE_AND_LINE, "x_: f64 = value");
ui_label(FILE_AND_LINE, "y_: f64 = value");
}
ui_label(FILE_AND_LINE, "y__: f64 = value");
defer_if (ui_push_expander(FILE_AND_LINE, "_inner_pos: v2f64_t").clicked, ui_pop_expander()) {
ui_label(FILE_AND_LINE, "x____: f64 = value");
ui_label(FILE_AND_LINE, "y____: f64 = value");
}
}
ui_label(FILE_AND_LINE, "alt: b8 = value");
ui_label(FILE_AND_LINE, "meta: b8 = value");
}
}
}
}