- Fix fp4 fixed-point misuse in PlaceholderCoverGenerator (advanceX is 12.4 fixed-point, not pixels) causing only first letter of each word to render - Remove duplicate silentIndexNextChapterIfNeeded() call from loop() that blocked UI before render, preventing the indexing indicator from showing - Fix indexing icon Y position to align within the status bar - Add ignoreNextConfirmRelease to EpubReaderChapterSelectionActivity so long-press confirm release doesn't immediately select the first TOC item - Reload recent books after cache deletion in HomeActivity and clear stale ignoreNextConfirmRelease flag to fix "no open books" and double-press bugs Made-with: Cursor
38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
#pragma once
|
|
#include <Epub.h>
|
|
|
|
#include <memory>
|
|
|
|
#include "../Activity.h"
|
|
#include "util/ButtonNavigator.h"
|
|
|
|
class EpubReaderChapterSelectionActivity final : public Activity {
|
|
std::shared_ptr<Epub> epub;
|
|
std::string epubPath;
|
|
ButtonNavigator buttonNavigator;
|
|
int currentSpineIndex = 0;
|
|
int selectorIndex = 0;
|
|
bool ignoreNextConfirmRelease = false;
|
|
|
|
// Number of items that fit on a page, derived from logical screen height.
|
|
// This adapts automatically when switching between portrait and landscape.
|
|
int getPageItems() const;
|
|
|
|
// Total TOC items count
|
|
int getTotalItems() const;
|
|
|
|
public:
|
|
explicit EpubReaderChapterSelectionActivity(GfxRenderer& renderer, MappedInputManager& mappedInput,
|
|
const std::shared_ptr<Epub>& epub, const std::string& epubPath,
|
|
const int currentSpineIndex, bool consumeFirstRelease = false)
|
|
: Activity("EpubReaderChapterSelection", renderer, mappedInput),
|
|
epub(epub),
|
|
epubPath(epubPath),
|
|
currentSpineIndex(currentSpineIndex),
|
|
ignoreNextConfirmRelease(consumeFirstRelease) {}
|
|
void onEnter() override;
|
|
void onExit() override;
|
|
void loop() override;
|
|
void render(RenderLock&&) override;
|
|
};
|