mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
refactor: Simplify reader menu activity handling by removing suppression logic
This commit is contained in:
parent
606b20d9d0
commit
78e9c7c733
@ -136,19 +136,7 @@ void EpubReaderActivity::loop() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Enter reader menu activity (suppressed after slider confirm/cancel).
|
||||
if (suppressMenuOpenOnce) {
|
||||
// If we're seeing the confirm release that closed the slider, consume it and return.
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
|
||||
suppressMenuOpenOnce = false;
|
||||
return;
|
||||
}
|
||||
// If confirm is no longer pressed and no release is pending, clear suppression.
|
||||
if (!mappedInput.isPressed(MappedInputManager::Button::Confirm)) {
|
||||
suppressMenuOpenOnce = false;
|
||||
}
|
||||
}
|
||||
|
||||
// Enter reader menu activity.
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
|
||||
// Don't start activity transition while rendering
|
||||
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
||||
@ -382,13 +370,11 @@ void EpubReaderActivity::onReaderMenuConfirm(EpubReaderMenuActivity::MenuAction
|
||||
[this](const int percent) {
|
||||
// Apply the new position and exit back to the reader.
|
||||
jumpToPercent(percent);
|
||||
suppressMenuOpenOnce = true;
|
||||
exitActivity();
|
||||
updateRequired = true;
|
||||
},
|
||||
[this]() {
|
||||
// Cancel selection and return to the reader.
|
||||
suppressMenuOpenOnce = true;
|
||||
exitActivity();
|
||||
updateRequired = true;
|
||||
}));
|
||||
|
||||
@ -23,8 +23,6 @@ class EpubReaderActivity final : public ActivityWithSubactivity {
|
||||
bool pendingPercentJump = false;
|
||||
// Normalized 0.0-1.0 progress within the target spine item, computed from book percentage.
|
||||
float pendingSpineProgress = 0.0f;
|
||||
// Prevents the reader menu from reopening due to the confirm button used to exit the slider.
|
||||
bool suppressMenuOpenOnce = false;
|
||||
bool updateRequired = false;
|
||||
const std::function<void()> onGoBack;
|
||||
const std::function<void()> onGoHome;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user