This commit is contained in:
Kenneth 2026-01-04 19:28:22 -05:00
parent e4c8ef07dd
commit 067a36a7b4

View File

@ -95,29 +95,39 @@ void HomeActivity::loop() {
const int menuCount = getMenuItemCount(); const int menuCount = getMenuItemCount();
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) { if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
// Menu order: [Continue Reading], [Recent Books], Browse, File transfer, Settings if (hasContinueReading && hasRecentBooks) {
// Calculate index offsets based on what's shown // Menu: Continue Reading, Recent Books, Browse, File transfer, Settings
int idx = selectorIndex; if (selectorIndex == 0) {
onContinueReading();
if (hasContinueReading && idx == 0) { } else if (selectorIndex == 1) {
onContinueReading(); onRecentBooksOpen();
return; } else if (selectorIndex == 2) {
} onReaderOpen();
if (hasContinueReading) idx--; } else if (selectorIndex == 3) {
onFileTransferOpen();
if (hasRecentBooks && idx == 0) { } else if (selectorIndex == 4) {
onRecentBooksOpen(); onSettingsOpen();
return; }
} } else if (hasContinueReading) {
if (hasRecentBooks) idx--; // Menu: Continue Reading, Browse, File transfer, Settings
if (selectorIndex == 0) {
// Now idx is 0-based for: Browse, File transfer, Settings onContinueReading();
if (idx == 0) { } else if (selectorIndex == 1) {
onReaderOpen(); onReaderOpen();
} else if (idx == 1) { } else if (selectorIndex == 2) {
onFileTransferOpen(); onFileTransferOpen();
} else if (idx == 2) { } else if (selectorIndex == 3) {
onSettingsOpen(); onSettingsOpen();
}
} else {
// Menu: Browse, File transfer, Settings
if (selectorIndex == 0) {
onReaderOpen();
} else if (selectorIndex == 1) {
onFileTransferOpen();
} else if (selectorIndex == 2) {
onSettingsOpen();
}
} }
} else if (prevPressed) { } else if (prevPressed) {
selectorIndex = (selectorIndex + menuCount - 1) % menuCount; selectorIndex = (selectorIndex + menuCount - 1) % menuCount;