mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-10-09 03:06:39 +00:00
build(wio-tracker-l2): LVGL 9.2.2 -> 9.6.0
The triangle draw descriptor's colour fields lost their bg_ prefix and style getters take an lv_part_t. 9.6 sizes flex containers through the layout, so popups no longer shrink when pulled past their end: lvgl_patches.py goes. The sim wipes its LVGL object cache when the library version changes. Flash +73 KB. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -58,7 +58,7 @@ namespace anim {
|
||||
lv_obj_remove_flag(cover, LV_OBJ_FLAG_CLICKABLE); // taps go through to the screen
|
||||
lv_obj_add_flag(cover, LV_OBJ_FLAG_IGNORE_LAYOUT);
|
||||
lv_obj_set_size(cover, LV_PCT(100), LV_PCT(100));
|
||||
lv_obj_set_style_bg_color(cover, lv_obj_get_style_bg_color(scr, 0), 0);
|
||||
lv_obj_set_style_bg_color(cover, lv_obj_get_style_bg_color(scr, LV_PART_MAIN), 0);
|
||||
run(cover, setBgOpa, LV_OPA_COVER, LV_OPA_TRANSP, SCREEN_MS, coverDone);
|
||||
if (body) run(body, setTy, back ? -6 : 6, 0, SCREEN_MS);
|
||||
}
|
||||
@@ -84,6 +84,6 @@ namespace anim {
|
||||
// Fade out, then hide (the object stays for reuse).
|
||||
static void fadeHide(lv_obj_t* o) {
|
||||
lv_anim_delete(o, setOpa);
|
||||
run(o, setOpa, lv_obj_get_style_opa(o, 0), LV_OPA_TRANSP, OUT_MS, hideDone);
|
||||
run(o, setOpa, lv_obj_get_style_opa(o, LV_PART_MAIN), LV_OPA_TRANSP, OUT_MS, hideDone);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,8 +65,8 @@ static void onCompassDraw(lv_event_t* e) {
|
||||
// Fixed pointer: points down at the ring, the heading always under it.
|
||||
lv_draw_triangle_dsc_t tri;
|
||||
lv_draw_triangle_dsc_init(&tri);
|
||||
tri.bg_color = lv_color_hex(theme::ACCENT);
|
||||
tri.bg_opa = LV_OPA_COVER;
|
||||
tri.color = lv_color_hex(theme::ACCENT);
|
||||
tri.opa = LV_OPA_COVER;
|
||||
tri.p[0].x = cx - 8; tri.p[0].y = cy - r - 12;
|
||||
tri.p[1].x = cx + 8; tri.p[1].y = cy - r - 12;
|
||||
tri.p[2].x = cx; tri.p[2].y = cy - r + 2;
|
||||
|
||||
@@ -1,60 +0,0 @@
|
||||
# Fixes to LVGL 9.2.2 (lib_deps) that ui-lvgl needs, applied in place to the
|
||||
# downloaded library -- idempotent, so every build can run it.
|
||||
#
|
||||
# PlatformIO: extra_scripts = pre:examples/companion_radio/ui-lvgl/lvgl_patches.py
|
||||
# (patches as LVGL is compiled, i.e. after lib_deps are fetched)
|
||||
# The sim: python3 examples/companion_radio/ui-lvgl/lvgl_patches.py <lvgl dir>
|
||||
#
|
||||
# Content height counted as scrolled (lv_obj_pos.c, calc_content_height): a
|
||||
# SIZE_CONTENT box capped by max_height measures its children where the scroll
|
||||
# has moved them, so an elastic pull past its end shrinks it by the overshoot,
|
||||
# again on every pull (popups with a list). The function zeroes scroll.y for
|
||||
# the count, but the children's coords already carry it; it's added back.
|
||||
import os
|
||||
import sys
|
||||
|
||||
PATCHES = [
|
||||
("src/core/lv_obj_pos.c", [
|
||||
(" /*Normal top aligns. */\n"
|
||||
" child_res_tmp = child->coords.y2 - obj->coords.y1 + 1;\n",
|
||||
" /*Normal top aligns. */\n"
|
||||
" child_res_tmp = child->coords.y2 - obj->coords.y1 + 1 + scroll_y_tmp;\n"),
|
||||
(" else {\n"
|
||||
" child_res_tmp = child->coords.y2 - obj->coords.y1 + 1;\n"
|
||||
" }\n",
|
||||
" else {\n"
|
||||
" child_res_tmp = child->coords.y2 - obj->coords.y1 + 1 + scroll_y_tmp;\n"
|
||||
" }\n"),
|
||||
]),
|
||||
]
|
||||
|
||||
|
||||
def apply(lvgl_dir):
|
||||
for rel, subs in PATCHES:
|
||||
path = os.path.join(lvgl_dir, rel)
|
||||
with open(path) as f:
|
||||
src = f.read()
|
||||
out = src
|
||||
for old, new in subs:
|
||||
if new in out:
|
||||
continue
|
||||
if out.count(old) != 1:
|
||||
raise RuntimeError("lvgl_patches: %s changed upstream, re-check the patch" % rel)
|
||||
out = out.replace(old, new)
|
||||
if out != src:
|
||||
with open(path, "w") as f:
|
||||
f.write(out)
|
||||
print("lvgl_patches: patched %s" % rel)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
apply(sys.argv[1])
|
||||
else:
|
||||
Import("env") # noqa: F821 (SCons)
|
||||
|
||||
def _patch(env, node):
|
||||
path = node.srcnode().get_abspath()
|
||||
apply(path[: path.rindex(os.sep + "src" + os.sep)])
|
||||
return node
|
||||
|
||||
env.AddBuildMiddleware(_patch, "*/lvgl/src/core/lv_obj_pos.c") # noqa: F821
|
||||
@@ -230,10 +230,10 @@ static void icon(lv_layer_t* layer, uint8_t cls, int32_t x, int32_t y) {
|
||||
r.border_opa = LV_OPA_COVER;
|
||||
lv_draw_triangle_dsc_t t;
|
||||
lv_draw_triangle_dsc_init(&t);
|
||||
t.bg_opa = LV_OPA_COVER;
|
||||
t.opa = LV_OPA_COVER;
|
||||
lv_area_t a;
|
||||
auto tri = [&](uint32_t col, int32_t x0, int32_t y0, int32_t x1, int32_t y1, int32_t x2, int32_t y2) {
|
||||
t.bg_color = lv_color_hex(col);
|
||||
t.color = lv_color_hex(col);
|
||||
t.p[0] = { (lv_value_precise_t)x0, (lv_value_precise_t)y0 };
|
||||
t.p[1] = { (lv_value_precise_t)x1, (lv_value_precise_t)y1 };
|
||||
t.p[2] = { (lv_value_precise_t)x2, (lv_value_precise_t)y2 };
|
||||
|
||||
Reference in New Issue
Block a user