feat(sleep-screen): add sleep screen orientation setting (#1748)

Co-authored-by: Travis Davis <me@tdavis.dev>
This commit is contained in:
xiro-codes
2026-05-08 11:41:06 +03:00
committed by GitHub
co-authored by Travis Davis
parent e8d7153d7f
commit e3fb3bba37
4 changed files with 8 additions and 1 deletions
+1
View File
@@ -63,6 +63,7 @@ STR_CAT_CONTROLS: "Controls"
STR_CAT_SYSTEM: "System"
STR_SLEEP_SCREEN: "Sleep Screen"
STR_SLEEP_COVER_MODE: "Sleep Screen Cover Mode"
STR_SLEEP_ORIENTATION: "Sleep Screen Orientation"
STR_HIDE_BATTERY: "Hide Battery %"
STR_EXTRA_SPACING: "Extra Paragraph Spacing"
STR_TEXT_AA: "Text Anti-Aliasing"
+2
View File
@@ -153,6 +153,8 @@ class CrossPointSettings {
uint8_t sleepScreenCoverMode = FIT;
// Sleep screen cover filter
uint8_t sleepScreenCoverFilter = NO_FILTER;
// Sleep screen orientation
uint8_t sleepScreenOrientation = PORTRAIT;
// Status bar settings (statusBar retained for migration only)
uint8_t statusBar = FULL;
uint8_t statusBarChapterPageCount = 1;
+3
View File
@@ -22,6 +22,9 @@ inline const std::vector<SettingInfo>& getSettingsList() {
"sleepScreen", StrId::STR_CAT_DISPLAY),
SettingInfo::Enum(StrId::STR_SLEEP_COVER_MODE, &CrossPointSettings::sleepScreenCoverMode,
{StrId::STR_FIT, StrId::STR_CROP}, "sleepScreenCoverMode", StrId::STR_CAT_DISPLAY),
SettingInfo::Enum(StrId::STR_SLEEP_ORIENTATION, &CrossPointSettings::sleepScreenOrientation,
{StrId::STR_PORTRAIT, StrId::STR_LANDSCAPE_CW, StrId::STR_INVERTED, StrId::STR_LANDSCAPE_CCW},
"sleepScreenOrientation", StrId::STR_CAT_DISPLAY),
SettingInfo::Enum(StrId::STR_SLEEP_COVER_FILTER, &CrossPointSettings::sleepScreenCoverFilter,
{StrId::STR_NONE_OPT, StrId::STR_FILTER_CONTRAST, StrId::STR_INVERTED},
"sleepScreenCoverFilter", StrId::STR_CAT_DISPLAY),
+2 -1
View File
@@ -22,11 +22,12 @@ void SleepActivity::onEnter() {
if (APP_STATE.lastSleepFromReader) {
ReaderUtils::applyOrientation(renderer, SETTINGS.orientation);
GUI.drawPopup(renderer, tr(STR_ENTERING_SLEEP));
renderer.setOrientation(GfxRenderer::Orientation::Portrait);
} else {
GUI.drawPopup(renderer, tr(STR_ENTERING_SLEEP));
}
ReaderUtils::applyOrientation(renderer, SETTINGS.sleepScreenOrientation);
switch (SETTINGS.sleepScreen) {
case (CrossPointSettings::SLEEP_SCREEN_MODE::BLANK):
return renderBlankSleepScreen();