mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
Add navigation hints to ChapterSelectionActivities (#294)
## Summary Add navigation hints to Chapter Select - #190 ### Before  ### After 
This commit is contained in:
parent
87287012ba
commit
66811bf50b
@ -16,7 +16,9 @@ int EpubReaderChapterSelectionActivity::getPageItems() const {
|
|||||||
constexpr int lineHeight = 30;
|
constexpr int lineHeight = 30;
|
||||||
|
|
||||||
const int screenHeight = renderer.getScreenHeight();
|
const int screenHeight = renderer.getScreenHeight();
|
||||||
const int availableHeight = screenHeight - startY;
|
const int endY = screenHeight - lineHeight;
|
||||||
|
|
||||||
|
const int availableHeight = endY - startY;
|
||||||
int items = availableHeight / lineHeight;
|
int items = availableHeight / lineHeight;
|
||||||
|
|
||||||
// Ensure we always have at least one item per page to avoid division by zero
|
// Ensure we always have at least one item per page to avoid division by zero
|
||||||
@ -134,5 +136,8 @@ void EpubReaderChapterSelectionActivity::renderScreen() {
|
|||||||
tocIndex != selectorIndex);
|
tocIndex != selectorIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto labels = mappedInput.mapLabels("« Back", "Select", "Up", "Down");
|
||||||
|
renderer.drawButtonHints(UI_10_FONT_ID, labels.btn1, labels.btn2, labels.btn3, labels.btn4);
|
||||||
|
|
||||||
renderer.displayBuffer();
|
renderer.displayBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,7 +14,9 @@ int XtcReaderChapterSelectionActivity::getPageItems() const {
|
|||||||
constexpr int lineHeight = 30;
|
constexpr int lineHeight = 30;
|
||||||
|
|
||||||
const int screenHeight = renderer.getScreenHeight();
|
const int screenHeight = renderer.getScreenHeight();
|
||||||
const int availableHeight = screenHeight - startY;
|
const int endY = screenHeight - lineHeight;
|
||||||
|
|
||||||
|
const int availableHeight = endY - startY;
|
||||||
int items = availableHeight / lineHeight;
|
int items = availableHeight / lineHeight;
|
||||||
if (items < 1) {
|
if (items < 1) {
|
||||||
items = 1;
|
items = 1;
|
||||||
@ -147,5 +149,8 @@ void XtcReaderChapterSelectionActivity::renderScreen() {
|
|||||||
renderer.drawText(UI_10_FONT_ID, 20, 60 + (i % pageItems) * 30, title, i != selectorIndex);
|
renderer.drawText(UI_10_FONT_ID, 20, 60 + (i % pageItems) * 30, title, i != selectorIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const auto labels = mappedInput.mapLabels("« Back", "Select", "Up", "Down");
|
||||||
|
renderer.drawButtonHints(UI_10_FONT_ID, labels.btn1, labels.btn2, labels.btn3, labels.btn4);
|
||||||
|
|
||||||
renderer.displayBuffer();
|
renderer.displayBuffer();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user