Adjust warnings for x3

This commit is contained in:
jpirnay
2026-04-20 20:50:33 +02:00
parent a6aed8d30e
commit a00712a085
2 changed files with 16 additions and 2 deletions
+2 -1
View File
@@ -112,7 +112,8 @@ STR_SHOW_FILE_EXTENSIONS: "Show File Extensions"
STR_USE_CLOCK: "Use Clock"
STR_USE_WEATHER: "Use Weather"
STR_CLOCK_SETTINGS: "Clock Settings"
STR_CLOCK_SETTINGS_WARNING: "Uses more battery; clock may drift"
STR_CLOCK_SETTINGS_WARNING_BATTERY: "Uses more battery"
STR_CLOCK_SETTINGS_WARNING_DRIFT: "Clock may drift"
STR_CLOCK: "Clock"
STR_CLOCK_FORMAT: "Clock Format"
STR_TIMEZONE: "Timezone"
@@ -2,14 +2,18 @@
#include <GfxRenderer.h>
#include <HalClock.h>
#include <HalGPIO.h>
#include <I18n.h>
#include <string>
#include "CrossPointSettings.h"
#include "DetectTimezoneActivity.h"
#include "SyncTimeActivity.h"
#include "components/UITheme.h"
#include "fontIds.h"
namespace {
const StrId timeZoneNames[CrossPointSettings::TIMEZONE_COUNT] = {
StrId::STR_TZ_UTC, StrId::STR_TZ_CET, StrId::STR_TZ_EET, StrId::STR_TZ_MSK,
@@ -96,10 +100,19 @@ void ClockSettingsActivity::render(RenderLock&&) {
GUI.drawHeader(renderer,
Rect(contentRect.x, contentRect.y + metrics.topPadding, contentRect.width, metrics.headerHeight),
tr(STR_CLOCK_SETTINGS));
const char* batteryWarning = tr(STR_CLOCK_SETTINGS_WARNING_BATTERY);
const char* driftWarning = tr(STR_CLOCK_SETTINGS_WARNING_DRIFT);
std::string warning = driftWarning;
if (!gpio.deviceIsX3()) {
warning = std::string(batteryWarning) + "; " + driftWarning;
}
GUI.drawSubHeader(renderer,
Rect(contentRect.x, contentRect.y + metrics.topPadding + metrics.headerHeight, contentRect.width,
metrics.tabBarHeight),
tr(STR_CLOCK_SETTINGS_WARNING));
warning.c_str());
const int contentTop =
contentRect.y + metrics.topPadding + metrics.headerHeight + metrics.tabBarHeight + metrics.verticalSpacing;