lvgl / lv_binding_rust

LVGL bindings for Rust. A powerful and easy-to-use embedded GUI with many widgets, advanced visual effects (opacity, antialiasing, animations) and low memory requirements (16K RAM, 64K Flash).
MIT License
687 stars 71 forks source link

Add support for switching screens #57

Closed Fabi019 closed 1 year ago

Fabi019 commented 1 year ago

This PR adds support for changing the current screen via the load_scr function based on the lv_disp_load_scr from lvgl.

Example usage:

// Default screen
let mut def_screen = ui.scr_act()?;
// Extra screen
let mut screen = Obj::default();
// ... Add style and widgets to each screen

// Load the extra screen
ui.load_scr(&mut screen);

// Change back to def_screen
ui.load_scr(&mut def_screen);
rafaelcaricio commented 1 year ago

Thank you! 😃 Merged, but please be aware that I am not actively maintaining this project anymore.