mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-02 19:02:00 +00:00
perf(l2): choice popups open smoothly, switches never cut short by a rebuild
A popup over a still screen is frozen and dimmed as it opens, so the panel's rise redraws only the panel: 6-8 frames of 19-25 ms instead of 3-4 of 45-65 ms. Picker options are one label each (time zone list 97 -> 52 ms to build). The bottom popup no longer animates a dim of 0. Repeater updates its hint in place (130 ms rebuild gone); Auto power, Imperial units and Relay on rebuild the screen after the knob has moved (rebuildSoon). -D PERF_CONTROLS times every control on the settings screens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -14,6 +14,7 @@ enum : uint8_t { RP_ON, RP_NETWORK, RP_PRESET, RP_SF, RP_BW, RP_CR, RP_HOPS, RP_
|
||||
static const int OPTS_LEN = 768;
|
||||
static char* s_opts = psramBuf<char>(OPTS_LEN); // dropdown options (LVGL copies them)
|
||||
static lv_obj_t* s_scopes_sub = nullptr; // "Extra scopes" row's count, updated from the popup
|
||||
static lv_obj_t* s_on_sub = nullptr; // the Repeater switch's hint
|
||||
|
||||
} // namespace rptview
|
||||
|
||||
@@ -56,6 +57,7 @@ void UITask::buildRepeater() {
|
||||
lv_obj_t* sw = switchRow(g, "Repeater", p->client_repeat ? "Relaying for others" : "Relay others' messages", nullptr);
|
||||
if (p->client_repeat) lv_obj_add_state(sw, LV_STATE_CHECKED);
|
||||
lv_obj_add_event_cb(sw, onRptSwitch, LV_EVENT_VALUE_CHANGED, (void*)(uintptr_t)RP_ON);
|
||||
s_on_sub = rowSub(lv_obj_get_parent(sw));
|
||||
groupNote(body, "Uses more battery; auto power pauses.");
|
||||
fill(&UITask::repeaterGroup, 1, 3); // the rest as the loop goes
|
||||
}
|
||||
@@ -124,6 +126,7 @@ void UITask::repeaterSet(int which, int v) {
|
||||
switch (which) {
|
||||
case RP_ON:
|
||||
rptctl::setEnabled(p, v != 0);
|
||||
if (s_on_sub) lv_label_set_text(s_on_sub, p->client_repeat ? "Relaying for others" : "Relay others' messages");
|
||||
break;
|
||||
case RP_NETWORK: rptctl::setUseProfile(p, v != 0); break;
|
||||
case RP_PRESET: if (v == 0) return; rptctl::choosePreset(p, v - 1); break;
|
||||
@@ -135,7 +138,8 @@ void UITask::repeaterSet(int which, int v) {
|
||||
case RP_SNR: p->repeat_min_snr = rptctl::snrFromChoice(v); break;
|
||||
}
|
||||
prefsSave();
|
||||
if (which <= RP_CR) rebuildRepeater(); // hints, the profile rows and the preset name follow
|
||||
if (which == RP_NETWORK) rebuildSoon(&UITask::rebuildRepeater); // the profile rows come or go, once it's moved
|
||||
else if (which > RP_NETWORK && which <= RP_CR) rebuildRepeater(); // hints, the profile rows and the preset name follow
|
||||
refreshStatusBar();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user