Short press will go back to origin / long press will go back to home

This commit is contained in:
jpirnay
2026-04-05 21:37:28 +02:00
parent c86a5fee4c
commit f75bbf5b1e
8 changed files with 32 additions and 23 deletions
+8 -4
View File
@@ -88,23 +88,27 @@ void ReaderActivity::goToLibrary(const std::string& fromBookPath) {
void ReaderActivity::onGoToEpubReader(std::unique_ptr<Epub> epub) {
const auto epubPath = epub->getPath();
currentBookPath = epubPath;
activityManager.replaceActivity(std::make_unique<EpubReaderActivity>(renderer, mappedInput, std::move(epub)));
startActivityForResult(std::make_unique<EpubReaderActivity>(renderer, mappedInput, std::move(epub)),
[this](const ActivityResult&) { finish(); });
}
void ReaderActivity::onGoToBmpViewer(const std::string& path) {
activityManager.replaceActivity(std::make_unique<BmpViewerActivity>(renderer, mappedInput, path));
startActivityForResult(std::make_unique<BmpViewerActivity>(renderer, mappedInput, path),
[this](const ActivityResult&) { finish(); });
}
void ReaderActivity::onGoToXtcReader(std::unique_ptr<Xtc> xtc) {
const auto xtcPath = xtc->getPath();
currentBookPath = xtcPath;
activityManager.replaceActivity(std::make_unique<XtcReaderActivity>(renderer, mappedInput, std::move(xtc)));
startActivityForResult(std::make_unique<XtcReaderActivity>(renderer, mappedInput, std::move(xtc)),
[this](const ActivityResult&) { finish(); });
}
void ReaderActivity::onGoToTxtReader(std::unique_ptr<Txt> txt) {
const auto txtPath = txt->getPath();
currentBookPath = txtPath;
activityManager.replaceActivity(std::make_unique<TxtReaderActivity>(renderer, mappedInput, std::move(txt)));
startActivityForResult(std::make_unique<TxtReaderActivity>(renderer, mappedInput, std::move(txt)),
[this](const ActivityResult&) { finish(); });
}
void ReaderActivity::onEnter() {