fix: long-press back should move to the start of chapter (#2243)
Co-authored-by: Julia <julia@uxj.io>
This commit is contained in:
@@ -338,11 +338,21 @@ void EpubReaderActivity::loop() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (longPress && SETTINGS.longPressButtonBehavior == SETTINGS.CHAPTER_SKIP) {
|
if (longPress && SETTINGS.longPressButtonBehavior == SETTINGS.CHAPTER_SKIP) {
|
||||||
|
if (!nextTriggered && section && section->currentPage > 0) {
|
||||||
|
section->currentPage = 0;
|
||||||
|
requestUpdate();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// We don't want to delete the section mid-render, so grab the semaphore
|
// We don't want to delete the section mid-render, so grab the semaphore
|
||||||
{
|
{
|
||||||
RenderLock lock(*this);
|
RenderLock lock(*this);
|
||||||
nextPageNumber = 0;
|
nextPageNumber = 0;
|
||||||
currentSpineIndex = nextTriggered ? currentSpineIndex + 1 : currentSpineIndex - 1;
|
if (nextTriggered) {
|
||||||
|
currentSpineIndex++;
|
||||||
|
} else if (currentSpineIndex > 0) {
|
||||||
|
currentSpineIndex--;
|
||||||
|
}
|
||||||
section.reset();
|
section.reset();
|
||||||
}
|
}
|
||||||
requestUpdate();
|
requestUpdate();
|
||||||
|
|||||||
Reference in New Issue
Block a user