fix: Fill the gap under the screen for the progress bar (#2138)

This commit is contained in:
Eloren1
2026-05-25 15:10:45 -04:00
committed by GitHub
parent b53ac3d52c
commit d7797baff2
3 changed files with 11 additions and 7 deletions
+8 -5
View File
@@ -721,8 +721,8 @@ void BaseTheme::fillPopupProgress(const GfxRenderer& renderer, const Rect& layou
}
void BaseTheme::drawStatusBar(GfxRenderer& renderer, const float bookProgress, const int currentPage,
const int pageCount, std::string title, const int paddingBottom,
const int textYOffset) const {
const int pageCount, std::string title, const int paddingBottom, const int textYOffset,
const bool fillMargin) const {
auto metrics = UITheme::getInstance().getMetrics();
int orientedMarginTop, orientedMarginRight, orientedMarginBottom, orientedMarginLeft;
renderer.getOrientedViewableTRBL(&orientedMarginTop, &orientedMarginRight, &orientedMarginBottom,
@@ -754,7 +754,9 @@ void BaseTheme::drawStatusBar(GfxRenderer& renderer, const float bookProgress, c
// Draw Progress Bar
if (SETTINGS.statusBarProgressBar != CrossPointSettings::STATUS_BAR_PROGRESS_BAR::HIDE_PROGRESS) {
const int progressBarMaxWidth = renderer.getScreenWidth() - orientedMarginLeft - orientedMarginRight;
const int barMarginLeft = fillMargin ? 0 : orientedMarginLeft;
const int barMarginRight = fillMargin ? 0 : orientedMarginRight;
const int progressBarMaxWidth = renderer.getScreenWidth() - barMarginLeft - barMarginRight;
const int progressBarY = renderer.getScreenHeight() - orientedMarginBottom -
((SETTINGS.statusBarProgressBarThickness + 1) * 2) - paddingBottom;
size_t progress;
@@ -765,8 +767,9 @@ void BaseTheme::drawStatusBar(GfxRenderer& renderer, const float bookProgress, c
progress = (pageCount > 0) ? (static_cast<float>(currentPage) / pageCount) * 100 : 0;
}
const int barWidth = progressBarMaxWidth * progress / 100;
renderer.fillRect(orientedMarginLeft, progressBarY, barWidth, ((SETTINGS.statusBarProgressBarThickness + 1) * 2),
true);
const int barHeight =
((SETTINGS.statusBarProgressBarThickness + 1) * 2) + (fillMargin ? orientedMarginBottom - 1 : 0);
renderer.fillRect(barMarginLeft, progressBarY, barWidth, barHeight, true);
}
// Draw Battery
+2 -1
View File
@@ -203,7 +203,8 @@ class BaseTheme {
virtual Rect drawPopup(const GfxRenderer& renderer, const char* message) const;
virtual void fillPopupProgress(const GfxRenderer& renderer, const Rect& layout, const int progress) const;
void drawStatusBar(GfxRenderer& renderer, const float bookProgress, const int currentPage, const int pageCount,
std::string title, const int paddingBottom = 0, const int textYOffset = 0) const;
std::string title, const int paddingBottom = 0, const int textYOffset = 0,
const bool fillMargin = true) const;
void drawHelpText(const GfxRenderer& renderer, Rect rect, const char* label) const;
virtual void drawTextField(const GfxRenderer& renderer, Rect rect, const int textWidth, bool cursorMode = false,
int contentStartX = 0, int contentWidth = 0) const;