mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-08 08:37:38 +03:00
Compare commits
1 Commits
83b0f5a621
...
f64ffe1428
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f64ffe1428 |
@ -5,8 +5,8 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "CrossPointSettings.h"
|
||||
#include "MappedInputManager.h"
|
||||
#include "CrossPointSettings.h"
|
||||
#include "RecentBooksStore.h"
|
||||
#include "ScreenComponents.h"
|
||||
#include "fontIds.h"
|
||||
|
||||
@ -179,7 +179,7 @@ void EpubReaderActivity::loop() {
|
||||
delayedSkipDir = nextPressed ? +1 : -1;
|
||||
delayedSkipExecuteAtMs = millis() + 500;
|
||||
xSemaphoreGive(renderingMutex);
|
||||
// Block changing page until unpressed skip button
|
||||
// Block release-based page change until unpressed
|
||||
awaitingReleaseAfterSkip = true;
|
||||
return;
|
||||
}
|
||||
@ -201,10 +201,6 @@ void EpubReaderActivity::loop() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (delayedSkipPending) {
|
||||
return;
|
||||
}
|
||||
|
||||
// any botton press when at end of the book goes back to the last page
|
||||
if (currentSpineIndex > 0 && currentSpineIndex >= epub->getSpineItemsCount()) {
|
||||
currentSpineIndex = epub->getSpineItemsCount() - 1;
|
||||
@ -213,6 +209,7 @@ void EpubReaderActivity::loop() {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// No current section, attempt to rerender the book
|
||||
if (!section) {
|
||||
updateRequired = true;
|
||||
@ -255,6 +252,7 @@ void EpubReaderActivity::displayTaskLoop() {
|
||||
renderScreen();
|
||||
xSemaphoreGive(renderingMutex);
|
||||
} else if (delayedSkipPending && now >= delayedSkipExecuteAtMs) {
|
||||
// Execute the delayed chapter skip now
|
||||
xSemaphoreTake(renderingMutex, portMAX_DELAY);
|
||||
nextPageNumber = 0;
|
||||
currentSpineIndex += delayedSkipDir;
|
||||
|
||||
@ -2,12 +2,15 @@
|
||||
|
||||
#include <GfxRenderer.h>
|
||||
|
||||
#include "CrossPointSettings.h"
|
||||
#include "KOReaderCredentialStore.h"
|
||||
#include "KOReaderSyncActivity.h"
|
||||
#include "CrossPointSettings.h"
|
||||
#include "MappedInputManager.h"
|
||||
#include "fontIds.h"
|
||||
|
||||
namespace {
|
||||
} // namespace
|
||||
|
||||
bool EpubReaderChapterSelectionActivity::hasSyncOption() const { return KOREADER_STORE.hasCredentials(); }
|
||||
|
||||
int EpubReaderChapterSelectionActivity::getTotalItems() const {
|
||||
|
||||
@ -128,7 +128,7 @@ void XtcReaderActivity::loop() {
|
||||
delayedSkipAmount = 10; // long-press skip amount
|
||||
delayedSkipExecuteAtMs = millis() + 500;
|
||||
xSemaphoreGive(renderingMutex);
|
||||
// Block changing page until unpressed skip button
|
||||
// Block release-based page change until unpressed
|
||||
awaitingReleaseAfterSkip = true;
|
||||
return;
|
||||
}
|
||||
@ -150,10 +150,6 @@ void XtcReaderActivity::loop() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (delayedSkipPending) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Handle end of book
|
||||
if (currentPage >= xtc->getPageCount()) {
|
||||
currentPage = xtc->getPageCount() - 1;
|
||||
|
||||
@ -6,6 +6,9 @@
|
||||
#include "MappedInputManager.h"
|
||||
#include "fontIds.h"
|
||||
|
||||
namespace {
|
||||
} // namespace
|
||||
|
||||
int XtcReaderChapterSelectionActivity::getPageItems() const {
|
||||
constexpr int startY = 60;
|
||||
constexpr int lineHeight = 30;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user