Review changes

This commit is contained in:
jpirnay
2026-04-27 14:38:20 +02:00
parent 2bce78c07a
commit ea99b764ce
13 changed files with 172 additions and 213 deletions
@@ -5,6 +5,7 @@
#include <algorithm>
#include "ButtonEventManager.h"
#include "MappedInputManager.h"
#include "components/UITheme.h"
#include "fontIds.h"
@@ -47,6 +48,10 @@ void XtcReaderChapterSelectionActivity::onEnter() {
void XtcReaderChapterSelectionActivity::onExit() { Activity::onExit(); }
void XtcReaderChapterSelectionActivity::loop() {
if (!xtc) {
return;
}
const int pageItems = getPageItems();
const int totalItems = static_cast<int>(xtc->getChapters().size());
@@ -82,11 +87,19 @@ void XtcReaderChapterSelectionActivity::loop() {
}
buttonNavigator.onNextRelease([this, totalItems] {
if (ButtonEventManager::hasDoubleAction(MappedInputManager::Button::Right) ||
ButtonEventManager::hasDoubleAction(MappedInputManager::Button::PageForward)) {
return;
}
selectorIndex = ButtonNavigator::nextIndex(selectorIndex, totalItems);
requestUpdate();
});
buttonNavigator.onPreviousRelease([this, totalItems] {
if (ButtonEventManager::hasDoubleAction(MappedInputManager::Button::Left) ||
ButtonEventManager::hasDoubleAction(MappedInputManager::Button::PageBack)) {
return;
}
selectorIndex = ButtonNavigator::previousIndex(selectorIndex, totalItems);
requestUpdate();
});