mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-04 04:40:50 +00:00
Clock picker fixes
This commit is contained in:
parent
6088ab49eb
commit
a33672db4f
@ -861,10 +861,9 @@ void Screen::setFrames(FrameFocus focus)
|
|||||||
indicatorIcons.push_back(icon_memory);
|
indicatorIcons.push_back(icon_memory);
|
||||||
}
|
}
|
||||||
#if !defined(DISPLAY_CLOCK_FRAME)
|
#if !defined(DISPLAY_CLOCK_FRAME)
|
||||||
LOG_INFO("Current state of graphics::ClockRenderer::digitalWatchFace is %s", graphics::ClockRenderer::digitalWatchFace);
|
|
||||||
fsi.positions.clock = numframes;
|
fsi.positions.clock = numframes;
|
||||||
normalFrames[numframes++] = graphics::ClockRenderer::digitalWatchFace ? graphics::ClockRenderer::drawDigitalClockFrame
|
normalFrames[numframes++] = graphics::ClockRenderer::digitalWatchFace ? graphics::ClockRenderer::drawDigitalClockFrame
|
||||||
: &graphics::ClockRenderer::drawAnalogClockFrame;
|
: graphics::ClockRenderer::drawAnalogClockFrame;
|
||||||
indicatorIcons.push_back(digital_icon_clock);
|
indicatorIcons.push_back(digital_icon_clock);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -21,6 +21,7 @@ namespace graphics
|
|||||||
|
|
||||||
namespace ClockRenderer
|
namespace ClockRenderer
|
||||||
{
|
{
|
||||||
|
bool digitalWatchFace = true;
|
||||||
|
|
||||||
void drawSegmentedDisplayColon(OLEDDisplay *display, int x, int y, float scale)
|
void drawSegmentedDisplayColon(OLEDDisplay *display, int x, int y, float scale)
|
||||||
{
|
{
|
||||||
|
@ -12,7 +12,7 @@ class Screen;
|
|||||||
namespace ClockRenderer
|
namespace ClockRenderer
|
||||||
{
|
{
|
||||||
// Whether we are showing the digital watch face or the analog one
|
// Whether we are showing the digital watch face or the analog one
|
||||||
static bool digitalWatchFace = true;
|
extern bool digitalWatchFace;
|
||||||
|
|
||||||
// Clock frame functions
|
// Clock frame functions
|
||||||
void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
void drawAnalogClockFrame(OLEDDisplay *display, OLEDDisplayUiState *state, int16_t x, int16_t y);
|
||||||
|
@ -105,7 +105,6 @@ void menuHandler::ClockFacePicker()
|
|||||||
graphics::ClockRenderer::digitalWatchFace = false;
|
graphics::ClockRenderer::digitalWatchFace = false;
|
||||||
screen->setFrames(); // Causes the screens to redraw, but doesn't change the face
|
screen->setFrames(); // Causes the screens to redraw, but doesn't change the face
|
||||||
}
|
}
|
||||||
service->reloadConfig(SEGMENT_CONFIG);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +174,7 @@ void menuHandler::TZPicker()
|
|||||||
void menuHandler::clockMenu()
|
void menuHandler::clockMenu()
|
||||||
{
|
{
|
||||||
static const char *optionsArray[] = {"Back", "Clock Face", "12-hour", "Timezone"};
|
static const char *optionsArray[] = {"Back", "Clock Face", "12-hour", "Timezone"};
|
||||||
screen->showOverlayBanner("Clock Menu", 30000, optionsArray, 3, [](int selected) -> void {
|
screen->showOverlayBanner("Clock Menu", 30000, optionsArray, 4, [](int selected) -> void {
|
||||||
if (selected == 1) {
|
if (selected == 1) {
|
||||||
menuHandler::menuQueue = menuHandler::clock_face_picker;
|
menuHandler::menuQueue = menuHandler::clock_face_picker;
|
||||||
screen->setInterval(0);
|
screen->setInterval(0);
|
||||||
@ -198,16 +197,16 @@ void menuHandler::messageResponseMenu()
|
|||||||
static const char **optionsArrayPtr;
|
static const char **optionsArrayPtr;
|
||||||
int options;
|
int options;
|
||||||
if (kb_found) {
|
if (kb_found) {
|
||||||
const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset", "Reply via Freetext"};
|
static const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset", "Reply via Freetext"};
|
||||||
optionsArrayPtr = optionsArray;
|
optionsArrayPtr = optionsArray;
|
||||||
options = 4;
|
options = 4;
|
||||||
} else {
|
} else {
|
||||||
const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset"};
|
static const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset"};
|
||||||
optionsArrayPtr = optionsArray;
|
optionsArrayPtr = optionsArray;
|
||||||
options = 3;
|
options = 3;
|
||||||
}
|
}
|
||||||
#ifdef HAS_I2S
|
#ifdef HAS_I2S
|
||||||
const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset", "Reply via Freetext", "Read Aloud"};
|
static const char *optionsArray[] = {"Back", "Dismiss", "Reply via Preset", "Reply via Freetext", "Read Aloud"};
|
||||||
optionsArrayPtr = optionsArray;
|
optionsArrayPtr = optionsArray;
|
||||||
options = 5;
|
options = 5;
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user