diff --git a/src/activities/settings/StatusBarSettingsActivity.cpp b/src/activities/settings/StatusBarSettingsActivity.cpp index 6c710ebe..11bbf541 100644 --- a/src/activities/settings/StatusBarSettingsActivity.cpp +++ b/src/activities/settings/StatusBarSettingsActivity.cpp @@ -81,11 +81,18 @@ void drawPreviewStatusItems(const GfxRenderer& renderer, const Rect& rect, const const bool showBatteryPercentage = SETTINGS.statusBarBattery && SETTINGS.hideBatteryPercentage == CrossPointSettings::HIDE_BATTERY_PERCENTAGE::HIDE_NEVER; + const bool showClock = SETTINGS.useClock && SETTINGS.statusBarClock; + const int previewClockWidth = showClock ? renderer.getTextWidth(SMALL_FONT_ID, "00:00") : 0; + if (SETTINGS.statusBarBattery) { GUI.drawBatteryLeft(renderer, Rect{rect.x + previewInnerMargin + 2, textY, metrics.batteryWidth, metrics.batteryHeight}, showBatteryPercentage); } + if (showClock) { + const int clockX = rect.x + previewInnerMargin + (SETTINGS.statusBarBattery ? metrics.batteryWidth + 8 : 0); + renderer.drawText(SMALL_FONT_ID, clockX, textY, "00:00"); + } int progressTextWidth = 0; if (hasProgressText) { @@ -118,6 +125,11 @@ void drawPreviewStatusItems(const GfxRenderer& renderer, const Rect& rect, const renderer.getTextWidth(SMALL_FONT_ID, "100%") + 8; leftReserve = std::max(leftReserve, percentReserve); } + if (showClock) { + leftReserve += previewClockWidth + 8; + } + } else if (showClock) { + leftReserve = std::max(leftReserve, previewClockWidth + 8); } const int rightReserve = progressTextWidth > 0 ? progressTextWidth + 18 : 6; const int titleAreaWidth = rect.width - previewInnerMargin * 2 - leftReserve - rightReserve; diff --git a/src/components/themes/BaseTheme.cpp b/src/components/themes/BaseTheme.cpp index 141835ec..82214bc4 100644 --- a/src/components/themes/BaseTheme.cpp +++ b/src/components/themes/BaseTheme.cpp @@ -853,7 +853,7 @@ void BaseTheme::drawStatusBar(GfxRenderer& renderer, const float bookProgress, c } // Draw Title - if (!title.empty()) { + if (SETTINGS.statusBarTitle != CrossPointSettings::STATUS_BAR_TITLE::HIDE_TITLE && !title.empty()) { const int rendererableScreenWidth = screenWidth - (metrics.statusBarHorizontalMargin * 2) - orientedMarginLeft - orientedMarginRight;