mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-05 23:27:38 +03:00
Initial push
This commit is contained in:
parent
21277e03eb
commit
68854812e9
@ -16,7 +16,7 @@ class CrossPointSettings {
|
|||||||
CrossPointSettings& operator=(const CrossPointSettings&) = delete;
|
CrossPointSettings& operator=(const CrossPointSettings&) = delete;
|
||||||
|
|
||||||
// Should match with SettingsActivity text
|
// Should match with SettingsActivity text
|
||||||
enum SLEEP_SCREEN_MODE { DARK = 0, LIGHT = 1, CUSTOM = 2, COVER = 3, BLANK = 4 };
|
enum SLEEP_SCREEN_MODE { DARK = 0, LIGHT = 1, CUSTOM = 2, COVER = 3, LAST_SCREEN = 4, BLANK = 5 };
|
||||||
enum SLEEP_SCREEN_COVER_MODE { FIT = 0, CROP = 1 };
|
enum SLEEP_SCREEN_COVER_MODE { FIT = 0, CROP = 1 };
|
||||||
|
|
||||||
// Status bar display type enum
|
// Status bar display type enum
|
||||||
|
|||||||
@ -28,6 +28,10 @@ void SleepActivity::onEnter() {
|
|||||||
return renderCoverSleepScreen();
|
return renderCoverSleepScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (SETTINGS.sleepScreen == CrossPointSettings::SLEEP_SCREEN_MODE::LAST_SCREEN) {
|
||||||
|
return renderLastScreenSleepScreen();
|
||||||
|
}
|
||||||
|
|
||||||
renderDefaultSleepScreen();
|
renderDefaultSleepScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,6 +272,26 @@ void SleepActivity::renderCoverSleepScreen() const {
|
|||||||
renderDefaultSleepScreen();
|
renderDefaultSleepScreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SleepActivity::renderLastScreenSleepScreen() const {
|
||||||
|
const int textWidth = renderer.getTextWidth(UI_12_FONT_ID, "SLEEPING...", EpdFontFamily::BOLD);
|
||||||
|
constexpr int margin = 20;
|
||||||
|
const int x = (renderer.getScreenWidth() - textWidth - margin * 2) / 2;
|
||||||
|
const int w = textWidth + margin * 2;
|
||||||
|
const int h = renderer.getLineHeight(UI_12_FONT_ID) + margin * 2;
|
||||||
|
const int y = renderer.getScreenHeight() - h - margin;
|
||||||
|
|
||||||
|
renderer.fillRect(x - 5, y - 5, w + 10, h + 10, true);
|
||||||
|
renderer.fillRect(x + 5, y + 5, w - 10, h - 10, false);
|
||||||
|
renderer.drawText(UI_12_FONT_ID, x + margin, y + margin, "SLEEPING...", true, EpdFontFamily::BOLD);
|
||||||
|
|
||||||
|
// Make sleep screen dark unless light is selected in settings
|
||||||
|
if (SETTINGS.sleepScreen == CrossPointSettings::SLEEP_SCREEN_MODE::DARK) {
|
||||||
|
// Draw dark sleep image
|
||||||
|
}
|
||||||
|
|
||||||
|
renderer.displayBuffer(EInkDisplay::HALF_REFRESH);
|
||||||
|
}
|
||||||
|
|
||||||
void SleepActivity::renderBlankSleepScreen() const {
|
void SleepActivity::renderBlankSleepScreen() const {
|
||||||
renderer.clearScreen();
|
renderer.clearScreen();
|
||||||
renderer.displayBuffer(EInkDisplay::HALF_REFRESH);
|
renderer.displayBuffer(EInkDisplay::HALF_REFRESH);
|
||||||
|
|||||||
@ -15,5 +15,6 @@ class SleepActivity final : public Activity {
|
|||||||
void renderCustomSleepScreen() const;
|
void renderCustomSleepScreen() const;
|
||||||
void renderCoverSleepScreen() const;
|
void renderCoverSleepScreen() const;
|
||||||
void renderBitmapSleepScreen(const Bitmap& bitmap) const;
|
void renderBitmapSleepScreen(const Bitmap& bitmap) const;
|
||||||
|
void renderLastScreenSleepScreen() const;
|
||||||
void renderBlankSleepScreen() const;
|
void renderBlankSleepScreen() const;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -16,7 +16,7 @@ namespace {
|
|||||||
constexpr int settingsCount = 20;
|
constexpr int settingsCount = 20;
|
||||||
const SettingInfo settingsList[settingsCount] = {
|
const SettingInfo settingsList[settingsCount] = {
|
||||||
// Should match with SLEEP_SCREEN_MODE
|
// Should match with SLEEP_SCREEN_MODE
|
||||||
SettingInfo::Enum("Sleep Screen", &CrossPointSettings::sleepScreen, {"Dark", "Light", "Custom", "Cover", "None"}),
|
SettingInfo::Enum("Sleep Screen", &CrossPointSettings::sleepScreen, {"Dark", "Light", "Custom", "Cover", "Last Screen" "None"}),
|
||||||
SettingInfo::Enum("Sleep Screen Cover Mode", &CrossPointSettings::sleepScreenCoverMode, {"Fit", "Crop"}),
|
SettingInfo::Enum("Sleep Screen Cover Mode", &CrossPointSettings::sleepScreenCoverMode, {"Fit", "Crop"}),
|
||||||
SettingInfo::Enum("Status Bar", &CrossPointSettings::statusBar, {"None", "No Progress", "Full"}),
|
SettingInfo::Enum("Status Bar", &CrossPointSettings::statusBar, {"None", "No Progress", "Full"}),
|
||||||
SettingInfo::Enum("Hide Battery %", &CrossPointSettings::hideBatteryPercentage, {"Never", "In Reader", "Always"}),
|
SettingInfo::Enum("Hide Battery %", &CrossPointSettings::hideBatteryPercentage, {"Never", "In Reader", "Always"}),
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user