Change sleep message to Moon icon

This commit is contained in:
Irene Ying 2026-01-25 10:22:11 -08:00
parent cecf5a3fa7
commit 91bcafebb9
2 changed files with 30 additions and 10 deletions

View File

@ -10,6 +10,7 @@
#include "CrossPointState.h"
#include "fontIds.h"
#include "images/CrossLarge.h"
#include "images/MoonIcon.h"
#include "util/StringUtils.h"
void SleepActivity::onEnter() {
@ -277,17 +278,9 @@ void SleepActivity::renderCoverSleepScreen() const {
}
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);
const auto pageHeight = renderer.getScreenHeight();
renderer.drawImage(MoonIcon, 48, pageHeight - 48, 48, 48);
renderer.displayBuffer(EInkDisplay::HALF_REFRESH);
}

27
src/images/MoonIcon.h Normal file
View 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, 0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