mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-03 03:11:57 +00:00
perf(l2): no redraws while nothing changes
Found by counting flushes on idle screens in the sim: - The compose field's cursor blinked (a redraw every 400 ms) as soon as a conversation opened, the keyboard hidden: lv_keyboard_set_textarea() focuses the field, and LVGL only stops a blink when the cursor moves. fieldFocus() sets the state and nudges the blink; also used for the WiFi and channel fields, which left theirs running. - lv_obj_align_to() restyles on every call, so the status bar's icons redrew every second; placeLeftOf() moves them only when they move. - Text colours set every second (nav bar, GPS status, Diag errors) go through setTextColor(), which skips an unchanged colour. - A LV_LABEL_LONG_DOT label writes its "..." into its own text, so setText() never matched and rewrote it every refresh (the nav bar's hint); labelShows() reads past the dots. - The map area, the area-outline, trail and vector-label layers were invalidated on every map refresh (every 3 s, a full-map redraw); now only when the view or what they draw changed. Idle map: 17 -> 1 flush in 5 s; list and settings screens: 0. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -325,13 +325,13 @@ void UITask::refreshGps() {
|
||||
bool fix = false;
|
||||
if (!g) {
|
||||
setText(s_status, "Not available");
|
||||
lv_obj_set_style_text_color(s_status, lv_color_hex(theme::TEXT_MUTED), 0);
|
||||
setTextColor(s_status, theme::TEXT_MUTED);
|
||||
} else if (off) {
|
||||
setText(s_status, "GPS is off");
|
||||
lv_obj_set_style_text_color(s_status, lv_color_hex(theme::TEXT_MUTED), 0);
|
||||
setTextColor(s_status, theme::TEXT_MUTED);
|
||||
} else if (!data) {
|
||||
setText(s_status, "No data");
|
||||
lv_obj_set_style_text_color(s_status, lv_color_hex(theme::FAIL), 0);
|
||||
setTextColor(s_status, theme::FAIL);
|
||||
#if defined(SEEED_WIO_TRACKER_L2)
|
||||
snprintf(used, sizeof(used), "Nothing from the receiver (%lu B)", (unsigned long)gps.rxChars());
|
||||
#else
|
||||
@@ -343,10 +343,10 @@ void UITask::refreshGps() {
|
||||
fix = g->hasFix();
|
||||
if (fix) {
|
||||
setText(s_status, g->fix_mode == 2 ? "2D fix" : "3D fix");
|
||||
lv_obj_set_style_text_color(s_status, lv_color_hex(theme::OK), 0);
|
||||
setTextColor(s_status, theme::OK);
|
||||
} else {
|
||||
setText(s_status, "Searching");
|
||||
lv_obj_set_style_text_color(s_status, lv_color_hex(theme::ACCENT), 0);
|
||||
setTextColor(s_status, theme::ACCENT);
|
||||
}
|
||||
snprintf(used, sizeof(used), "%d of %d used", fix ? (used_n ? used_n : g->sats_used) : 0, s_n);
|
||||
snprintf(inview, sizeof(inview), "%d heard", tracked);
|
||||
|
||||
Reference in New Issue
Block a user