v8.0 brings many new features like simplified and more powerful scrolling, new layouts inspired by CSS Flexbox and Grid, simplified and improved widgets, more powerful events, hookable drawing, and more.
v8 is a major change and therefore it's not backward compatible with v7. See the migration guide below for details on upgrading your projects.
Directory Structure#
The project organization has been streamlined for better maintainability:
- The
lv_prefix is removed from the folder names - The
docsis moved to thelvglrepository - The
examplesare moved to thelvglrepository - Created an
src/extrafolder for complex widgets:- Makes the core LVGL leaner
- Provides space for numerous and specific widgets
- Offers a great place for community contributions
Widget Changes#
Several widgets have been consolidated and reimagined:
lv_contremoved - layout features are moved tolv_objlv_pageremoved - scroll features are moved tolv_objlv_objmaskremoved - the same can be achieved by eventslv_meteradded as the union oflv_linemeterandlv_gaugelv_spannew widget mimicking HTML<span>lv_animimgnew widget for simple slideshow animations- Plus many minor changes and improvements
New Scrolling System#
Scrolling is now more flexible and works on any object:
- Support "elastic" scrolling when scrolled beyond bounds
- Support scroll chaining among any object types (not only
lv_pages) - Remove
lv_drag- similar effect can be achieved by setting the position inLV_EVENT_PRESSING - Add snapping support
- Add snap stop to scroll max 1 snap point
New Layouts#
LVGL now supports modern CSS-style layouts:
- CSS Grid-like layout support
- CSS Flexbox-like layout support
Style System Improvements#
The style system has been optimized and simplified:
- State is saved in the object instead of the style property
- Object size and position can be set in styles too
Enhanced Events#
Events are now more flexible and powerful:
- Allow adding multiple events to an object
- A
user_datacan be attached to added events
Driver Changes#
Display and input device driver initialization has changed in v8. Review these changes carefully when migrating.
lv_disp_drv_t,lv_indev_drv_t,lv_fs_drv_tneed to bestatic...disp_buf...is renamed todraw_buf. See an initialization example here- No partial update if two screen-sized buffers are set
disp_drv->full_refresh = 1makes always the whole display redrawhor_resandver_resneed to be set indisp_drvindev_read_cbreturnsvoid. To indicate that there is more data to read, setdata->continue_reading = 1in theread_cb
Other Notable Changes#
- Remove the copy parameter from create functions
- Simplified File system interface API
- Use a more generic inheritance model
- The built-in themes are reworked
lv_obj_alignnow saves the alignment and realigns the object automatically but can only align to the parentlv_obj_align_tocan align to any object but doesn't save the alignmentlv_pct(x)can be used to set the size and position in percentage- There are many other changes in widgets that are not detailed here. Please refer to the documentation of the widgets.
New Release Policy#
We will follow Release branches with GitLab flow:
- Minor releases are expected every 3-4 months
masterwill always contain the latest changes
Migrating from v7 to v8#
First and foremost, create a new lv_conf.h based on lv_conf_template.h.
To try the new version, it's recommended to use a simulator project and see the examples.
When migrating your project to v8:
- Update the drivers as described above
- Update the styles
- Update the events
- Use the new layouts instead of
lv_contfeatures - Use
lv_objinstead oflv_page - The other parts are mainly minor renames and refactoring. See the functions' documentation for descriptions.
For detailed migration instructions, see the v8 Migration Guide.
