
### Maintenance page * Add add tab color for mobile view * Add spellcheck off / autocorect off in input * Add disconnect button when authenticate enabled * Add Invalid user or password message when authentication failed ### Board support * Add ESP32 S2 support * Add ESP32 S3 support * Add ESP32 C3 support ### ESP commands * Add command 701 to control GCODE streaming * Remove command 901 as duplicate * Update command 420 to add more details * Use text as default output * All json on all commands for formated output ### Core * Add benchmak function to check transfer speed (for test only-not production) * Merge code for ESP3DLib support * Add better printer display support (M117 / Serial TFT) * Use ESP32 analogWrite instead of emulated one ### Modules * Display * Refactor code * Remove SPI ILI 9341 / 9488 support as not suitable * Add ST7789 support (135x240 / 240x240) * Filesystem * Bug fixes due to esp core updates * Better SD sharing mecanism * Better global FS management * FTP * Add SD sharing support * Better global FS management * GCODE Host * Add basic support for macro files * Add ESP command support * Use not blocking method to stream commands / handle response * Notifications * Add IFTTT notification service * Add WebUI notification * Add ESP3D display notification * WebDav * Add SD sharing support * Add bug fix from https://github.com/d-a-v/ESPWebDAV * Better global FS management * Websocket * Add function to handle zombies connections * WiFi * Fix connection to AP sometime fail * Fix low signal not diplayed in ESP420 even connected * Add AP Setup mode ### Libraries * Update SDFat-2.0.6 to 2.1.2 * Update ESP32SSDP 1.1.1 to 1.2.0 * Update TFT_eSPI-1.4.11 to 2.4.61 * Update arduinoWebSockets-2.3.5 to 2.3.6 * Update esp8266-oled-ssd1306-4.0.0 to 4.3.0 * Remove lvgl support ### Tools * Add I2C scanner script * Add python script to simulate/stress printer serial communication ### PlatformIO * Use latest 4.4.0 Espressif32 release (ESP32-arduino core 2.0.3) * Add fix for Flash more than 4MB * Add Esp32 S2/S3/C3 env * Add ESP32-ST7789 / esp32-TTGO_T_Display env
2.8 KiB
.. include:: /header.rst
:github_url: |github_link_base|/overview/layer.md
Layers
Order of creation
By default, LVGL draws new objects on top of old objects.
For example, assume we add a button to a parent object named button1 and then another button named button2. Then button1 (along with its child object(s)) will be in the background and can be covered by button2 and its children.
/*Create a screen*/
lv_obj_t * scr = lv_obj_create(NULL, NULL);
lv_scr_load(scr); /*Load the screen*/
/*Create 2 buttons*/
lv_obj_t * btn1 = lv_btn_create(scr, NULL); /*Create a button on the screen*/
lv_btn_set_fit(btn1, true, true); /*Enable automatically setting the size according to content*/
lv_obj_set_pos(btn1, 60, 40); /*Set the position of the button*/
lv_obj_t * btn2 = lv_btn_create(scr, btn1); /*Copy the first button*/
lv_obj_set_pos(btn2, 180, 80); /*Set the position of the button*/
/*Add labels to the buttons*/
lv_obj_t * label1 = lv_label_create(btn1, NULL); /*Create a label on the first button*/
lv_label_set_text(label1, "Button 1"); /*Set the text of the label*/
lv_obj_t * label2 = lv_label_create(btn2, NULL); /*Create a label on the second button*/
lv_label_set_text(label2, "Button 2"); /*Set the text of the label*/
/*Delete the second label*/
lv_obj_del(label2);
Bring to the foreground
There are four explicit ways to bring an object to the foreground:
- Use
lv_obj_move_foreground(obj)
to bring an object to the foreground. Similarly, uselv_obj_move_background(obj)
to move it to the background. - Use
lv_obj_move_up(obj)
to move an object one position up in the hierarchy, Similarly, uselv_obj_move_down(obj)
to move an object one position down in the hierarchy. - Use
lv_obj_swap(obj1, obj2)
to swap the relative layer position of two objects. - When
lv_obj_set_parent(obj, new_parent)
is used,obj
will be on the foreground of thenew_parent
.
Top and sys layers
LVGL uses two special layers named layer_top
and layer_sys
.
Both are visible and common on all screens of a display. They are not, however, shared among multiple physical displays. The layer_top
is always on top of the default screen (lv_scr_act()
), and layer_sys
is on top of layer_top
.
The layer_top
can be used by the user to create some content visible everywhere. For example, a menu bar, a pop-up, etc. If the click
attribute is enabled, then layer_top
will absorb all user clicks and acts as a modal.
lv_obj_add_flag(lv_layer_top(), LV_OBJ_FLAG_CLICKABLE);
The layer_sys
is also used for similar purposes in LVGL. For example, it places the mouse cursor above all layers to be sure it's always visible.