zephr/ui: introduce IDs to ui elements to track the active element

This commit is contained in:
2024-01-08 05:55:58 +02:00
parent 56a6ace875
commit 0b89bf2390
6 changed files with 212 additions and 130 deletions
-6
View File
@@ -1073,15 +1073,9 @@ bool zephr_iter_events(ZephrEvent *event_out) {
break;
case Button2:
event_out->mouse.button = ZEPHR_MOUSE_BUTTON_MIDDLE;
if (!inside_rect(&zephr_ctx->ui.popup_rect, &event_out->mouse.position)) {
zephr_ctx->ui.popup_open = false;
}
break;
case Button3:
event_out->mouse.button = ZEPHR_MOUSE_BUTTON_RIGHT;
if (!inside_rect(&zephr_ctx->ui.popup_rect, &event_out->mouse.position)) {
zephr_ctx->ui.popup_open = false;
}
break;
}