feat(obj) add lv_obj_swap() function (#2461)

* proposal for lv_obj_swap() function

* review issues applied

* review changes for comments
This commit is contained in:
Karijn Wessing
2021-08-18 11:32:10 +02:00
committed by GitHub
parent 36ddbd0756
commit 9a1f7f2fcb
8 changed files with 153 additions and 1 deletions

View File

@@ -40,8 +40,9 @@ lv_obj_del(label2);
## Bring to the foreground
There are 2 explicit way to bring an object to the foreground:
There are 3 explicit way to bring an object to the foreground:
- Use `lv_obj_move_foreground(obj)` to explicitly tell the library to bring an object to the foreground. Similarly, use `lv_obj_move_background(obj)` to move to the background.
- Use `lv_obj_swap(obj1, obj2)` to swap the relative position of two objects.
- When `lv_obj_set_parent(obj, new_parent)` is used, `obj` will be on the foreground on the `new_parent`.
## Top and sys layers