Review changes

This commit is contained in:
jpirnay
2026-04-30 12:19:27 +02:00
parent b6c90fdac6
commit f0218c194d
3 changed files with 31 additions and 1 deletions
+1 -1
View File
@@ -286,8 +286,8 @@ class CrossPointSettings {
BTN_PREV_SECTION,
BTN_EXIT_READER,
BTN_READER_MENU,
BTN_TOGGLE_BIONIC_READING,
BTN_KOREADER_SYNC,
BTN_TOGGLE_BIONIC_READING,
BUTTON_ACTION_COUNT
};
+23
View File
@@ -85,6 +85,29 @@ RecentBook RecentBooksStore::getBookByPath(const std::string& path) const {
return RecentBook{};
}
bool RecentBooksStore::setReaderOverrides(const std::string& path, const int8_t embeddedStyleOverride,
const int8_t imageRenderingOverride) {
auto it =
std::find_if(recentBooks.begin(), recentBooks.end(), [&](const RecentBook& book) { return book.path == path; });
if (it == recentBooks.end()) {
return false;
}
return setReaderOverrides(path, embeddedStyleOverride, imageRenderingOverride, it->fontFamilyOverride,
it->fontSizeOverride, it->bionicReadingOverride);
}
bool RecentBooksStore::setReaderOverrides(const std::string& path, const int8_t embeddedStyleOverride,
const int8_t imageRenderingOverride, const int8_t fontFamilyOverride,
const int8_t fontSizeOverride) {
auto it =
std::find_if(recentBooks.begin(), recentBooks.end(), [&](const RecentBook& book) { return book.path == path; });
if (it == recentBooks.end()) {
return false;
}
return setReaderOverrides(path, embeddedStyleOverride, imageRenderingOverride, fontFamilyOverride, fontSizeOverride,
it->bionicReadingOverride);
}
bool RecentBooksStore::setReaderOverrides(const std::string& path, const int8_t embeddedStyleOverride,
const int8_t imageRenderingOverride, const bool bionicReadingOverride) {
auto it =
@@ -2007,6 +2007,13 @@ void EpubReaderActivity::onButtonAction(const CrossPointSettings::BUTTON_ACTION
openReaderMenu();
}
break;
case BA::BTN_TOGGLE_BIONIC_READING:
if (epub) {
applyBookReaderOverrides(bookEmbeddedStyleOverride, bookImageRenderingOverride, bookFontFamilyOverride,
bookFontSizeOverride, !bookBionicReadingOverride);
requestUpdate();
}
break;
case BA::BTN_KOREADER_SYNC:
launchKOReaderSync(SyncLaunchMode::COMPARE);
break;