Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mvladic committed Sep 29, 2024
1 parent fcf1060 commit 14b8fcc
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
17 changes: 13 additions & 4 deletions packages/project-editor/lvgl/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,19 @@ export class LVGLBuild extends Build {
`void *flowState = lv_event_get_user_data(e);`
);

build.line("");

if (widget.hasEventHandler) {
widget.buildEventHandler(build);
}

if (
widget.eventHandlers.length > 0 &&
widget.hasEventHandler
) {
build.line("");
}

for (const eventHandler of widget.eventHandlers) {
if (
eventHandler.eventName == "CHECKED" ||
Expand Down Expand Up @@ -537,10 +550,6 @@ export class LVGLBuild extends Build {
build.line("}");
}

if (widget.hasEventHandler) {
widget.buildEventHandler(build);
}

build.unindent();
build.line("}");
build.line("");
Expand Down
2 changes: 1 addition & 1 deletion packages/project-editor/lvgl/widgets/Base.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ export class LVGLWidget extends Widget {
propertyGridGroup: generalGroup,
hideInPropertyGrid: (widget: LVGLWidget) =>
ProjectEditor.getProject(widget).lvglGroups.groups.length ==
0
0 || widget instanceof LVGLScreenWidget
},
{
name: "groupIndex",
Expand Down
2 changes: 1 addition & 1 deletion packages/project-editor/lvgl/widgets/Screen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ export class LVGLScreenWidget extends LVGLWidget {
ProjectEditor.PageClass.classInfo
) as Page;

build.line("if (event == LV_EVENT_SCREEN_LOADED) {");
build.line("if (event == LV_EVENT_SCREEN_LOAD_START) {");
build.indent();

for (const group of allGroups) {
Expand Down

0 comments on commit 14b8fcc

Please sign in to comment.