fix: Fill the gap under the screen for the progress bar (#2138)
This commit is contained in:
@@ -251,7 +251,7 @@ void StatusBarSettingsActivity::render(RenderLock&&) {
|
||||
title = tr(STR_EXAMPLE_CHAPTER);
|
||||
}
|
||||
|
||||
GUI.drawStatusBar(renderer, 75, 8, 32, title, verticalPreviewPadding);
|
||||
GUI.drawStatusBar(renderer, 75, 8, 32, title, verticalPreviewPadding, 0, false);
|
||||
|
||||
renderer.drawText(UI_10_FONT_ID, metrics.contentSidePadding,
|
||||
renderer.getScreenHeight() - UITheme::getInstance().getStatusBarHeight() - verticalPreviewPadding -
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user