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

View File

@ -95,30 +95,40 @@ 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) {
if (hasContinueReading && idx == 0) {
onContinueReading(); onContinueReading();
return; } else if (selectorIndex == 1) {
}
if (hasContinueReading) idx--;
if (hasRecentBooks && idx == 0) {
onRecentBooksOpen(); onRecentBooksOpen();
return; } else if (selectorIndex == 2) {
}
if (hasRecentBooks) idx--;
// Now idx is 0-based for: Browse, File transfer, Settings
if (idx == 0) {
onReaderOpen(); onReaderOpen();
} else if (idx == 1) { } else if (selectorIndex == 3) {
onFileTransferOpen(); onFileTransferOpen();
} else if (idx == 2) { } else if (selectorIndex == 4) {
onSettingsOpen(); onSettingsOpen();
} }
} else if (hasContinueReading) {
// Menu: Continue Reading, Browse, File transfer, Settings
if (selectorIndex == 0) {
onContinueReading();
} else if (selectorIndex == 1) {
onReaderOpen();
} else if (selectorIndex == 2) {
onFileTransferOpen();
} else if (selectorIndex == 3) {
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;
updateRequired = true; updateRequired = true;