mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-03 12:20:43 +00:00
Maintain clock frame when switching between Clock Faces
This commit is contained in:
parent
cea5cd171a
commit
7a285cf221
@ -930,6 +930,11 @@ void Screen::setFrames(FrameFocus focus)
|
||||
// If no module requested focus, will show the first frame instead
|
||||
ui->switchToFrame(fsi.positions.focusedModule);
|
||||
break;
|
||||
case FOCUS_CLOCK:
|
||||
// Whichever frame was marked by MeshModule::requestFocus(), if any
|
||||
// If no module requested focus, will show the first frame instead
|
||||
ui->switchToFrame(fsi.positions.clock);
|
||||
break;
|
||||
|
||||
case FOCUS_PRESERVE:
|
||||
// No more adjustment — force stay on same index
|
||||
|
@ -24,6 +24,7 @@ class Screen
|
||||
FOCUS_FAULT,
|
||||
FOCUS_TEXTMESSAGE,
|
||||
FOCUS_MODULE, // Note: target module should call requestFocus(), otherwise no info about which module to focus
|
||||
FOCUS_CLOCK,
|
||||
};
|
||||
|
||||
explicit Screen(ScanI2C::DeviceAddress, meshtastic_Config_DisplayConfig_OledType, OLEDDISPLAY_GEOMETRY);
|
||||
@ -208,6 +209,7 @@ class Screen : public concurrency::OSThread
|
||||
FOCUS_FAULT,
|
||||
FOCUS_TEXTMESSAGE,
|
||||
FOCUS_MODULE, // Note: target module should call requestFocus(), otherwise no info about which module to focus
|
||||
FOCUS_CLOCK,
|
||||
};
|
||||
|
||||
// Regenerate the normal set of frames, focusing a specific frame if requested
|
||||
|
@ -104,10 +104,10 @@ void menuHandler::ClockFacePicker()
|
||||
menuHandler::menuQueue = menuHandler::clock_menu;
|
||||
} else if (selected == 1) {
|
||||
graphics::ClockRenderer::digitalWatchFace = true;
|
||||
screen->setFrames();
|
||||
screen->setFrames(Screen::FOCUS_CLOCK);
|
||||
} else {
|
||||
graphics::ClockRenderer::digitalWatchFace = false;
|
||||
screen->setFrames();
|
||||
screen->setFrames(Screen::FOCUS_CLOCK);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user