Compare commits

..

9 Commits

Author SHA1 Message Date
Luke Stein
de68a7d67f
Merge 9b8d565b99 into e5c0ddc9fa 2026-02-01 22:13:42 +00:00
copilot-swe-agent[bot]
9b8d565b99 Refactor duplicate progress bar functions into drawStatusProgressBar
Co-authored-by: lukestein <44452336+lukestein@users.noreply.github.com>
2026-02-01 22:13:39 +00:00
Luke Stein
58c2d8453e Fix progress bar vertical alignment 2026-02-01 16:32:26 -05:00
copilot-swe-agent[bot]
0645ad9632 Fix text overlap with chapter progress bar by adjusting textY position
Co-authored-by: lukestein <44452336+lukestein@users.noreply.github.com>
2026-02-01 16:32:26 -05:00
copilot-swe-agent[bot]
df8ce19144 Remove accidentally added llvm.sh script
Co-authored-by: lukestein <44452336+lukestein@users.noreply.github.com>
2026-02-01 16:32:26 -05:00
copilot-swe-agent[bot]
a28a9ab6d6 Run clang-format on modified files
Co-authored-by: lukestein <44452336+lukestein@users.noreply.github.com>
2026-02-01 16:32:26 -05:00
Luke Stein
1beef69f82 Rename progress bar height variable and make 6 pixels 2026-02-01 16:32:26 -05:00
copilot-swe-agent[bot]
30b56eb977 Add Chapter Progress Bar status bar option
Co-authored-by: lukestein <44452336+lukestein@users.noreply.github.com>
2026-02-01 16:32:26 -05:00
copilot-swe-agent[bot]
e0db851db9 Initial plan 2026-02-01 16:32:26 -05:00
4 changed files with 7 additions and 30 deletions

View File

@ -74,25 +74,14 @@ void ScreenComponents::fillPopupProgress(const GfxRenderer& renderer, const Popu
renderer.displayBuffer(HalDisplay::FAST_REFRESH);
}
void ScreenComponents::drawBookProgressBar(const GfxRenderer& renderer, const size_t bookProgress) {
void ScreenComponents::drawStatusProgressBar(const GfxRenderer& renderer, const size_t progress) {
int vieweableMarginTop, vieweableMarginRight, vieweableMarginBottom, vieweableMarginLeft;
renderer.getOrientedViewableTRBL(&vieweableMarginTop, &vieweableMarginRight, &vieweableMarginBottom,
&vieweableMarginLeft);
const int progressBarMaxWidth = renderer.getScreenWidth() - vieweableMarginLeft - vieweableMarginRight;
const int progressBarY = renderer.getScreenHeight() - vieweableMarginBottom - PROGRESS_BAR_HEIGHT;
const int barWidth = progressBarMaxWidth * bookProgress / 100;
renderer.fillRect(vieweableMarginLeft, progressBarY, barWidth, PROGRESS_BAR_HEIGHT, true);
}
void ScreenComponents::drawChapterProgressBar(const GfxRenderer& renderer, const size_t chapterProgress) {
int vieweableMarginTop, vieweableMarginRight, vieweableMarginBottom, vieweableMarginLeft;
renderer.getOrientedViewableTRBL(&vieweableMarginTop, &vieweableMarginRight, &vieweableMarginBottom,
&vieweableMarginLeft);
const int progressBarMaxWidth = renderer.getScreenWidth() - vieweableMarginLeft - vieweableMarginRight;
const int progressBarY = renderer.getScreenHeight() - vieweableMarginBottom - PROGRESS_BAR_HEIGHT;
const int barWidth = progressBarMaxWidth * chapterProgress / 100;
const int barWidth = progressBarMaxWidth * progress / 100;
renderer.fillRect(vieweableMarginLeft, progressBarY, barWidth, PROGRESS_BAR_HEIGHT, true);
}

View File

@ -22,20 +22,8 @@ class ScreenComponents {
int height;
};
struct PopupLayout {
int x;
int y;
int width;
int height;
};
static void drawBattery(const GfxRenderer& renderer, int left, int top, bool showPercentage = true);
static void drawBookProgressBar(const GfxRenderer& renderer, size_t bookProgress);
static void drawChapterProgressBar(const GfxRenderer& renderer, size_t chapterProgress);
static PopupLayout drawPopup(const GfxRenderer& renderer, const char* message);
static void fillPopupProgress(const GfxRenderer& renderer, const PopupLayout& layout, int progress);
static void drawStatusProgressBar(const GfxRenderer& renderer, size_t progress);
static PopupLayout drawPopup(const GfxRenderer& renderer, const char* message);

View File

@ -541,14 +541,14 @@ void EpubReaderActivity::renderStatusBar(const int orientedMarginRight, const in
if (showBookProgressBar) {
// Draw progress bar at the very bottom of the screen, from edge to edge of viewable area
ScreenComponents::drawBookProgressBar(renderer, static_cast<size_t>(bookProgress));
ScreenComponents::drawStatusProgressBar(renderer, static_cast<size_t>(bookProgress));
}
if (showChapterProgressBar) {
// Draw chapter progress bar at the very bottom of the screen, from edge to edge of viewable area
const float chapterProgress =
(section->pageCount > 0) ? (static_cast<float>(section->currentPage + 1) / section->pageCount) * 100 : 0;
ScreenComponents::drawChapterProgressBar(renderer, static_cast<size_t>(chapterProgress));
ScreenComponents::drawStatusProgressBar(renderer, static_cast<size_t>(chapterProgress));
}
if (showBattery) {

View File

@ -527,12 +527,12 @@ void TxtReaderActivity::renderStatusBar(const int orientedMarginRight, const int
if (showProgressBar) {
// Draw progress bar at the very bottom of the screen, from edge to edge of viewable area
ScreenComponents::drawBookProgressBar(renderer, static_cast<size_t>(progress));
ScreenComponents::drawStatusProgressBar(renderer, static_cast<size_t>(progress));
}
if (showChapterProgressBar) {
// For text mode, treat the entire book as one chapter, so chapter progress == book progress
ScreenComponents::drawChapterProgressBar(renderer, static_cast<size_t>(progress));
ScreenComponents::drawStatusProgressBar(renderer, static_cast<size_t>(progress));
}
if (showBattery) {