mirror of
https://github.com/pelgraine/Meck.git
synced 2026-08-06 16:52:46 +02:00
Fix alarm screen hint text when autolock has been applied
This commit is contained in:
@@ -1085,6 +1085,11 @@ static uint32_t _atoi(const char* sp) {
|
||||
#include "MapScreen.h" // After BLE -- PNGdec headers conflict with BLE if included earlier
|
||||
#endif
|
||||
UITask ui_task(&board, &serial_interface);
|
||||
#ifdef MECK_AUDIO_VARIANT
|
||||
// Lets the alarm ringing screen (which only forward-declares UITask) query
|
||||
// the lock state without pulling in the full UITask header.
|
||||
bool meck_alarm_is_locked() { return ui_task.isLocked(); }
|
||||
#endif
|
||||
#endif
|
||||
|
||||
StdRNG fast_rng;
|
||||
|
||||
@@ -53,6 +53,10 @@ void meck_alarm_haptic_buzz();
|
||||
void meck_alarm_haptic_stop();
|
||||
#endif
|
||||
|
||||
// Lock-state query, defined in main.cpp. This UI header only forward-declares
|
||||
// UITask, so it cannot call _task->isLocked() directly; the shim bridges it.
|
||||
bool meck_alarm_is_locked();
|
||||
|
||||
// ============================================================================
|
||||
// Configuration
|
||||
// ============================================================================
|
||||
@@ -753,11 +757,16 @@ private:
|
||||
// Dismiss instruction — large and obvious
|
||||
display.setColor(DisplayDriver::GREEN);
|
||||
display.setTextSize(1);
|
||||
display.drawTextCentered(display.width() / 2, 64, "ANY KEY: Dismiss");
|
||||
if (meck_alarm_is_locked()) {
|
||||
// Keys are ignored while locked; the user unlocks with the button first.
|
||||
display.drawTextCentered(display.width() / 2, 64, "Unlock to dismiss");
|
||||
} else {
|
||||
display.drawTextCentered(display.width() / 2, 64, "ANY KEY: Dismiss");
|
||||
|
||||
display.setTextSize(0);
|
||||
display.setColor(DisplayDriver::LIGHT);
|
||||
display.drawTextCentered(display.width() / 2, 80, "Z: Snooze 5 min");
|
||||
display.setTextSize(0);
|
||||
display.setColor(DisplayDriver::LIGHT);
|
||||
display.drawTextCentered(display.width() / 2, 80, "Z: Snooze 5 min");
|
||||
}
|
||||
|
||||
// No footer in ringing mode — keep it clean and urgent
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user