mirror of
https://github.com/lvgl/lvgl.git
synced 2026-10-02 10:23:47 +08:00
chore(migration): add obj flags migration script (#10380)
Co-authored-by: Akos Vandra-Meyer <axos88@users.noreply.github.com>
This commit is contained in:
co-authored by
Akos Vandra-Meyer
parent
c9245ffd2a
commit
c738d776e5
@@ -399,7 +399,14 @@ if you need finer control.
|
||||
bool h = lv_obj_is_hidden(obj);
|
||||
```
|
||||
The custom-bit flags (`LV_OBJ_FLAG_USER_1`–`4`) can be accessed via
|
||||
`lv_obj_set/get_user_flag()`
|
||||
`lv_obj_set/get_user_flag()`, which take a bit from 0 to 3 e.g `lv_obj_set_user_flag(obj, 0, true)`
|
||||
instead of lv_obj_get/set-flag(obj, LV_OBJ_FLAG_USER_1).
|
||||
|
||||
A migration script is available at `scripts/migration/migrate_obj_flags.py`:
|
||||
```bash
|
||||
python3 scripts/migration/migrate_obj_flags.py path/to/your/project
|
||||
```
|
||||
_Note: Only raw flag constants can be converted automatically. Expressions using variables will be skipped for safety._
|
||||
|
||||
---
|
||||
|
||||
|
||||
@@ -8,7 +8,8 @@ Flags are deprecated in LVGL v9.6 and will be removed in LVGL v10.
|
||||
Use a dedicated function instead, such as <ApiLink name="lv_obj_set_hidden"/>.
|
||||
|
||||
<ApiLink name="lv_obj_set_user_flag"/> and <ApiLink name="lv_obj_get_user_flag"/>
|
||||
can be used to replace `LV_OBJ_FLAG_USER_1-4`.
|
||||
can be used to replace `LV_OBJ_FLAG_USER_1-4`, it takes in a bit from 0 to 3 instead
|
||||
of the old flag constant, e.g `lv_obj_set_user_flag(obj, 0, true)`
|
||||
</Callout>
|
||||
|
||||
Some widget attributes can be enabled or disabled using
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user