Add orientation change to button actions

This commit is contained in:
jpirnay
2026-05-04 13:27:40 +02:00
parent 4c936853b9
commit 6eae99362d
7 changed files with 33 additions and 2 deletions
@@ -2016,6 +2016,14 @@ void EpubReaderActivity::onButtonAction(const CrossPointSettings::BUTTON_ACTION
requestUpdate();
}
break;
case BA::BTN_CYCLE_ORIENTATION:
if (epub) {
const uint8_t nextOrientation =
static_cast<uint8_t>((SETTINGS.orientation + 1) % CrossPointSettings::ORIENTATION_COUNT);
applyOrientation(nextOrientation);
requestUpdate();
}
break;
case BA::BTN_KOREADER_SYNC:
launchKOReaderSync(SyncLaunchMode::COMPARE);
break;
@@ -995,6 +995,15 @@ void MdReaderActivity::onButtonAction(const CrossPointSettings::BUTTON_ACTION ac
ReaderUtils::enforceExitFullRefresh(renderer);
finish();
break;
case BA::BTN_CYCLE_ORIENTATION: {
const uint8_t nextOrientation =
static_cast<uint8_t>((SETTINGS.orientation + 1) % CrossPointSettings::ORIENTATION_COUNT);
SETTINGS.orientation = nextOrientation;
SETTINGS.saveToFile();
ReaderUtils::applyOrientation(renderer, SETTINGS.orientation);
requestUpdate();
break;
}
default:
break;
}
@@ -833,6 +833,15 @@ void TxtReaderActivity::onButtonAction(const CrossPointSettings::BUTTON_ACTION a
ReaderUtils::enforceExitFullRefresh(renderer);
finish();
break;
case BA::BTN_CYCLE_ORIENTATION: {
const uint8_t nextOrientation =
static_cast<uint8_t>((SETTINGS.orientation + 1) % CrossPointSettings::ORIENTATION_COUNT);
SETTINGS.orientation = nextOrientation;
SETTINGS.saveToFile();
ReaderUtils::applyOrientation(renderer, SETTINGS.orientation);
requestUpdate();
break;
}
default:
break;
}