feat: add 0.5 second option to power on/off delays (#5134)

This commit is contained in:
philmoz
2024-06-10 11:55:31 +10:00
committed by GitHub
parent aa87148fe9
commit 6207b1eae6
10 changed files with 111 additions and 50 deletions
+3 -3
View File
@@ -760,10 +760,10 @@ static SetupLineDef setupLines[] = {
STR_PWR_OFF_DELAY,
[](Window* parent, coord_t x, coord_t y) {
new Choice(
parent, {x, y, 0, EdgeTxStyles::UI_ELEMENT_HEIGHT}, STR_PWR_OFF_DELAYS, 0, 3,
[=]() -> int32_t { return 2 - g_eeGeneral.pwrOffSpeed; },
parent, {x, y, 0, EdgeTxStyles::UI_ELEMENT_HEIGHT}, STR_PWR_OFF_DELAYS, 0, 4,
[=]() -> int32_t { return pwrDelayFromYaml(g_eeGeneral.pwrOffSpeed); },
[=](int32_t newValue) {
g_eeGeneral.pwrOffSpeed = 2 - newValue;
g_eeGeneral.pwrOffSpeed = pwrDelayToYaml(newValue);
SET_DIRTY();
});
}
+1 -1
View File
@@ -247,7 +247,7 @@ void drawShutdownAnimation(uint32_t duration, uint32_t totalDuration,
}
}
int quarter = 3 - duration / (totalDuration / 5);
int quarter = 4 - (duration * 5) / totalDuration;
if (quarter < 0) quarter = 0;
for (int i = 3; i >= quarter; i -= 1) shutdownAnim[i]->hide();