mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 22:57:50 +03:00
Change sleep message to Moon icon
This commit is contained in:
parent
cecf5a3fa7
commit
91bcafebb9
@ -10,6 +10,7 @@
|
|||||||
#include "CrossPointState.h"
|
#include "CrossPointState.h"
|
||||||
#include "fontIds.h"
|
#include "fontIds.h"
|
||||||
#include "images/CrossLarge.h"
|
#include "images/CrossLarge.h"
|
||||||
|
#include "images/MoonIcon.h"
|
||||||
#include "util/StringUtils.h"
|
#include "util/StringUtils.h"
|
||||||
|
|
||||||
void SleepActivity::onEnter() {
|
void SleepActivity::onEnter() {
|
||||||
@ -277,17 +278,9 @@ void SleepActivity::renderCoverSleepScreen() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SleepActivity::renderLastScreenSleepScreen() const {
|
void SleepActivity::renderLastScreenSleepScreen() const {
|
||||||
const int textWidth = renderer.getTextWidth(UI_12_FONT_ID, "SLEEPING...", EpdFontFamily::BOLD);
|
const auto pageHeight = renderer.getScreenHeight();
|
||||||
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);
|
|
||||||
|
|
||||||
|
renderer.drawImage(MoonIcon, 48, pageHeight - 48, 48, 48);
|
||||||
renderer.displayBuffer(EInkDisplay::HALF_REFRESH);
|
renderer.displayBuffer(EInkDisplay::HALF_REFRESH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
27
src/images/MoonIcon.h
Normal file
27
src/images/MoonIcon.h
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <cstdint>
|
||||||
|
|
||||||
|
// Image dimensions: 48x48
|
||||||
|
#define MOONICON_WIDTH 48
|
||||||
|
#define MOONICON_HEIGHT 48
|
||||||
|
|
||||||
|
static const uint8_t MoonIcon[] = {
|
||||||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xFF, 0xFF, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xE7, 0xFF,
|
||||||
|
0xFF, 0xFF, 0xFF, 0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xFF, 0xFB, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF9,
|
||||||
|
0xFF, 0xF7, 0xFF, 0xFF, 0xFF, 0xF9, 0xFF, 0xF0, 0xFF, 0xFF, 0xFF, 0xC0, 0x1F, 0xF0, 0x3F, 0xFF,
|
||||||
|
0xFF, 0x00, 0x1F, 0xF8, 0x0F, 0xFF, 0xFF, 0xF0, 0x7F, 0xFC, 0x07, 0xFF, 0xFF, 0xF9, 0xFF, 0xFC,
|
||||||
|
0x07, 0xFF, 0xFF, 0xF9, 0xFF, 0xFC, 0x03, 0xFF, 0xFF, 0xF9, 0xFF, 0xFE, 0x01, 0xFF, 0xFF, 0xFF,
|
||||||
|
0xFF, 0xFE, 0x01, 0xFF, 0xFF,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