Reusing widgets in EEZ Studio

I’m using EEZStudio to design a number of pages (screens) for a project. I have a notification widget area (think of it like the notification area in android at the top of the screen) with some icons and a label to display the time etc and I want to use that same widget at the top of each screen.

I’ve created the widget under the “User Widget” in EEZStudio and I can then drag that widget in to each display page. It looks great and works however I’ve found that rather than reuse the same widget in each page, the exported LVGL code creates a separate copy of each of the components within the widget.

For example, upon code export, each page contains an object which contains a copy of all the components in the widget, each with a unique name. If I have a few pages and I want to update the time displayed at the top of the screen I either have to work out which copy of the time label I need to update for a specific page or update all copies of the time label so that it does not matter which page is being displayed.

Am I misunderstanding how this is supposed to work? What I’d like to happen is that I update one label with the current time and that label is shown regardless of which page is displayed since it’s part of the user widget which is at the top of each page.

Environment

  • MCU/MPU/Board: esp32S3 with 800x480px display using ESP_IDF
  • LVGL version: 9.4.0
  • EEZStudio version: 0.24.0

Hello,

I cannot help you with EEZ studio, but I have a similar concept in my application, where I have just put the top bar on lv_layer_top() so it is always active. Perhaps this is an option for you? That way there is only one label for each item in your notification area.

1 Like

Thank you, yes that’s a good solution. I actually put a message on the Github for the EEZStudio project and they responded with a similar solution to use the lv_layer_top along with example code to make it work.