Merge remote-tracking branch 'origin/master' into feat-touch
This commit is contained in:
@@ -312,6 +312,32 @@ void EpubReaderActivity::loop() {
|
||||
return;
|
||||
}
|
||||
|
||||
// auto [prevTriggered, nextTriggered] = ReaderUtils::detectPageTurn(mappedInput);
|
||||
|
||||
// Handle short power button press for footnotes
|
||||
if (SETTINGS.shortPwrBtn == CrossPointSettings::SHORT_PWRBTN::FOOTNOTES &&
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Power) &&
|
||||
!mappedInput.wasReleased(MappedInputManager::Button::Down)) {
|
||||
if (footnoteDepth > 0) {
|
||||
restoreSavedPosition();
|
||||
} else {
|
||||
if (currentPageFootnotes.size() == 1) {
|
||||
navigateToHref(currentPageFootnotes[0].href, true);
|
||||
} else if (currentPageFootnotes.size() > 1) {
|
||||
startActivityForResult(
|
||||
std::make_unique<EpubReaderFootnotesActivity>(renderer, mappedInput, currentPageFootnotes),
|
||||
[this](const ActivityResult& result) {
|
||||
if (!result.isCancelled) {
|
||||
const auto& footnoteResult = std::get<FootnoteResult>(result.data);
|
||||
navigateToHref(footnoteResult.href, true);
|
||||
}
|
||||
requestUpdate();
|
||||
});
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
const auto [prevTriggered, nextTriggered, fromTilt] = ReaderUtils::detectPageTurn(mappedInput);
|
||||
if (!prevTriggered && !nextTriggered) {
|
||||
return;
|
||||
|
||||
@@ -26,7 +26,8 @@ void EpubReaderFootnotesActivity::loop() {
|
||||
return;
|
||||
}
|
||||
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
|
||||
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm) ||
|
||||
mappedInput.wasReleased(MappedInputManager::Button::Power)) {
|
||||
if (selectedIndex >= 0 && selectedIndex < static_cast<int>(footnotes.size())) {
|
||||
setResult(FootnoteResult{footnotes[selectedIndex].href});
|
||||
finish();
|
||||
|
||||
@@ -46,6 +46,10 @@ void SettingsActivity::rebuildSettingsLists() {
|
||||
} else if (setting.category == StrId::STR_CAT_READER) {
|
||||
readerSettings.push_back(setting);
|
||||
} else if (setting.category == StrId::STR_CAT_CONTROLS) {
|
||||
if (setting.valuePtr == &CrossPointSettings::pwrBtnFootnoteBack &&
|
||||
SETTINGS.shortPwrBtn != CrossPointSettings::SHORT_PWRBTN::FOOTNOTES) {
|
||||
continue;
|
||||
}
|
||||
controlsSettings.push_back(setting);
|
||||
} else if (setting.category == StrId::STR_CAT_SYSTEM) {
|
||||
systemSettings.push_back(setting);
|
||||
@@ -271,6 +275,8 @@ void SettingsActivity::toggleCurrentSetting() {
|
||||
|
||||
syncQuickResumeTimeoutForSleepScreen(sleepScreenChanged, quickResumeTimeoutChanged);
|
||||
SETTINGS.saveToFile();
|
||||
rebuildSettingsLists();
|
||||
selectedSettingIndex = std::min(selectedSettingIndex, settingsCount);
|
||||
}
|
||||
|
||||
void SettingsActivity::syncQuickResumeTimeoutForSleepScreen(bool sleepScreenChanged, bool quickResumeTimeoutChanged) {
|
||||
|
||||
Reference in New Issue
Block a user