LVGLBuilder
LVGLBuilder copied to clipboard
Redundant Code Generation for every widget state.
I have found that when generating code, a lot settings are duplicated resulting in unneeded bloat and wasted flash/memory space.
LVGL widgets will always use the styles/settings for the DEFAULT state unless that specific property is overridden for the current state.
This builder seems to always explicitly generate definitions for every possible state no matter if it was modified or not.
For example: If you add a simple button widget, and give it a text string, and change is border color. The generated code will include unique definitions for every single possible Button State, most of which are redundant.
On a simple page with 10 Widgets and minor styling, the resultant code is around 183 lines. After going through the code manually, and deleting redundant declarations, it can be simplified to less then 70 lines.
Awesome Tool BTW!
Yes, I also realized this problem. I found that the official value comparison function will not work. So store the value of some commonly used component styles to a file, read it when the program starts, and then export the code again. To compare values, this will filter out a lot of invalid codes.
@mrQzs I found the way LVGLBuilder gets widget's properties for different states maybe is incorrect , that's why comparison function not work.
@d985201002 Thank you for finding the problem, you can submit the code~