Review changes
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user