I am in the progress of migrating an app from v7 to v8. So far most issues could be solved. But so far I have two issues which I wasn’t able to solve so far:
Labels in “LONG_WRAP” mode aren’t centered anymore when using set_align(lv.ALIGN.CENTER). Instead the individual lines are left aligned.
Example:
label = lv.label(page)
label.set_long_mode(lv.label.LONG.WRAP);
label.set_width(210);
label.set_text("This is a long line that will wrap and should be centered.");
label.set_align(lv.ALIGN.CENTER)
label.align(lv.ALIGN.TOP_MID, 0, 0)
The keyboard has a cancel event but there is no cancel button in the default layouts anymore (or i am too stupid to see it). Do I now have to provide a complete custom button layout if I’d like to see the cancel button?
Labels of (too) small buttons aren’t centered properly anymore.
One further question, please: lv.win.close_event_cb is gone. How is a windows close button now supposed to be used to close a window? The window object also has no close member or similar. Is win.del_async() the way to go?
And another one: Window now has a add_title method instead of set_title. And this new method actually adds another title. How do i now update the title? Get access to the header and its label and update that manually?
If win.del_async() is a valid way to close the window, why would we then want another (redundant) way to do it? Imho it makes sense to keep the API simple and avoid duplicates.
In general v8 already feels much more straight forward to me than v7.
The only non obvious thing is how to get the window from the button. In the button’s event you see the button and need to get the parent’s parent to get the window. lv_win_get_from_button() could be moew flexible.
But then a generic “get_root_window” method may be more useful. These special buttons are probably not the only case where you want to deal with the root window of some widget.
But the suggested VALUE_CHANGE callback only fires when the user has changed the selection so this cannot be used to style the list. I think the docs should suggest to use CLICKED instead as this fires when the list is being drawn.
Yes. If you’re impatient, you can probably just cd lib/lv_bindings/lvgl && git checkout master && git pull. Usually that works without problems as the binding generation script is quite resilient.
There’s also a CI test that checks every push/pull-request on LVGL by building the latest lv_micropython with the new LVGL and running all Python examples.
So if CI tests pass it’s generally very safe to assume that the new LVGL would work with latest lv_micropython.