Review comments
This commit is contained in:
@@ -81,11 +81,18 @@ void drawPreviewStatusItems(const GfxRenderer& renderer, const Rect& rect, const
|
|||||||
const bool showBatteryPercentage =
|
const bool showBatteryPercentage =
|
||||||
SETTINGS.statusBarBattery &&
|
SETTINGS.statusBarBattery &&
|
||||||
SETTINGS.hideBatteryPercentage == CrossPointSettings::HIDE_BATTERY_PERCENTAGE::HIDE_NEVER;
|
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) {
|
if (SETTINGS.statusBarBattery) {
|
||||||
GUI.drawBatteryLeft(renderer,
|
GUI.drawBatteryLeft(renderer,
|
||||||
Rect{rect.x + previewInnerMargin + 2, textY, metrics.batteryWidth, metrics.batteryHeight},
|
Rect{rect.x + previewInnerMargin + 2, textY, metrics.batteryWidth, metrics.batteryHeight},
|
||||||
showBatteryPercentage);
|
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;
|
int progressTextWidth = 0;
|
||||||
if (hasProgressText) {
|
if (hasProgressText) {
|
||||||
@@ -118,6 +125,11 @@ void drawPreviewStatusItems(const GfxRenderer& renderer, const Rect& rect, const
|
|||||||
renderer.getTextWidth(SMALL_FONT_ID, "100%") + 8;
|
renderer.getTextWidth(SMALL_FONT_ID, "100%") + 8;
|
||||||
leftReserve = std::max(leftReserve, percentReserve);
|
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 rightReserve = progressTextWidth > 0 ? progressTextWidth + 18 : 6;
|
||||||
const int titleAreaWidth = rect.width - previewInnerMargin * 2 - leftReserve - rightReserve;
|
const int titleAreaWidth = rect.width - previewInnerMargin * 2 - leftReserve - rightReserve;
|
||||||
|
|||||||
@@ -853,7 +853,7 @@ void BaseTheme::drawStatusBar(GfxRenderer& renderer, const float bookProgress, c
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Draw Title
|
// Draw Title
|
||||||
if (!title.empty()) {
|
if (SETTINGS.statusBarTitle != CrossPointSettings::STATUS_BAR_TITLE::HIDE_TITLE && !title.empty()) {
|
||||||
const int rendererableScreenWidth =
|
const int rendererableScreenWidth =
|
||||||
screenWidth - (metrics.statusBarHorizontalMargin * 2) - orientedMarginLeft - orientedMarginRight;
|
screenWidth - (metrics.statusBarHorizontalMargin * 2) - orientedMarginLeft - orientedMarginRight;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user