fix(ui): partial-refresh time-set digit blink instead of full screen

UI_ShowSetTimePage() cleared and redrew the entire screen on every
500ms blink toggle and on every up/down value change, causing a
full-screen flash instead of just the intended hour/minute digit
blinking. Split out UI_UpdateSetTimeDigit() which only repaints the
32x32px digit region for the field being edited; the full page draw
is now only used on entry. Field-switch (long-press CONFIRM) refreshes
both digit regions to clear any stale blanked-out state.
This commit is contained in:
edisondeng
2026-07-31 19:14:14 +08:00
parent d4b89c9336
commit dac2ea4335
3 changed files with 59 additions and 34 deletions

View File

@@ -63,8 +63,8 @@ static void SetClockApp_onRun(void)
if (blink != time_edit_blink_on)
{
time_edit_blink_on = blink;
// 每次闪烁状态发生变化,重新刷写屏幕数值
UI_ShowSetTimePage(current_hour, current_min, time_edit_field, time_edit_blink_on);
// 每次闪烁状态发生变化,只局部刷新正在调节的那个数字,不整屏重绘
UI_UpdateSetTimeDigit(current_hour, current_min, time_edit_field, time_edit_blink_on);
}
}
@@ -90,7 +90,8 @@ static EventResult SetClockApp_onEvent(SystemEvent *evt)
} else {
current_min = (current_min + 1) % 60;
}
UI_ShowSetTimePage(current_hour, current_min, time_edit_field, 1);
time_edit_blink_on = 1; // 调值后强制显示 (不处于消隐周期)
UI_UpdateSetTimeDigit(current_hour, current_min, time_edit_field, 1);
return EVENT_HANDLED;
}
if (evt->key_event == KEY_EVENT_DOWN_CLICK)
@@ -101,7 +102,8 @@ static EventResult SetClockApp_onEvent(SystemEvent *evt)
} else {
current_min = (current_min == 0) ? 59 : (current_min - 1);
}
UI_ShowSetTimePage(current_hour, current_min, time_edit_field, 1);
time_edit_blink_on = 1; // 调值后强制显示 (不处于消隐周期)
UI_UpdateSetTimeDigit(current_hour, current_min, time_edit_field, 1);
return EVENT_HANDLED;
}
if (evt->key_event == KEY_EVENT_CONFIRM_LONG)
@@ -112,7 +114,10 @@ static EventResult SetClockApp_onEvent(SystemEvent *evt)
} else {
time_edit_field = 1;
}
UI_ShowSetTimePage(current_hour, current_min, time_edit_field, 1);
time_edit_blink_on = 1; // 切换焦点后两个字段都应处于可见状态
// 两个数字区域都局部刷新一次,避免切换前正处于消隐周期的那个数字停留在涂黑状态
UI_UpdateSetTimeDigit(current_hour, current_min, 1, 1);
UI_UpdateSetTimeDigit(current_hour, current_min, 2, 1);
return EVENT_HANDLED;
}
if (evt->key_event == KEY_EVENT_CONFIRM_CLICK)