Fix formatting

This commit is contained in:
Dave Allie 2025-12-15 23:17:23 +11:00
parent a640fbecf8
commit 108cf57202
No known key found for this signature in database
GPG Key ID: F2FDDB3AD8D0276F
8 changed files with 21 additions and 30 deletions

View File

@ -47,8 +47,7 @@ class ChapterHtmlSlimParser {
public: public:
explicit ChapterHtmlSlimParser(const char* filepath, GfxRenderer& renderer, const int fontId, explicit ChapterHtmlSlimParser(const char* filepath, GfxRenderer& renderer, const int fontId,
const float lineCompression, const int marginTop, const int marginRight, const float lineCompression, const int marginTop, const int marginRight,
const int marginBottom, const int marginLeft, const int marginBottom, const int marginLeft, const bool extraParagraphSpacing,
const bool extraParagraphSpacing,
const std::function<void(std::unique_ptr<Page>)>& completePageFn) const std::function<void(std::unique_ptr<Page>)>& completePageFn)
: filepath(filepath), : filepath(filepath),
renderer(renderer), renderer(renderer),

View File

@ -24,9 +24,7 @@ class CrossPointSettings {
~CrossPointSettings() = default; ~CrossPointSettings() = default;
// Get singleton instance // Get singleton instance
static CrossPointSettings& getInstance() { static CrossPointSettings& getInstance() { return instance; }
return instance;
}
bool saveToFile() const; bool saveToFile() const;
bool loadFromFile(); bool loadFromFile();

View File

@ -205,8 +205,8 @@ void EpubReaderScreen::renderScreen() {
const auto filepath = epub->getSpineItem(currentSpineIndex); const auto filepath = epub->getSpineItem(currentSpineIndex);
Serial.printf("[%lu] [ERS] Loading file: %s, index: %d\n", millis(), filepath.c_str(), currentSpineIndex); Serial.printf("[%lu] [ERS] Loading file: %s, index: %d\n", millis(), filepath.c_str(), currentSpineIndex);
section = std::unique_ptr<Section>(new Section(epub, currentSpineIndex, renderer)); section = std::unique_ptr<Section>(new Section(epub, currentSpineIndex, renderer));
if (!section->loadCacheMetadata(READER_FONT_ID, lineCompression, marginTop, marginRight, marginBottom, if (!section->loadCacheMetadata(READER_FONT_ID, lineCompression, marginTop, marginRight, marginBottom, marginLeft,
marginLeft, SETTINGS.extraParagraphSpacing)) { SETTINGS.extraParagraphSpacing)) {
Serial.printf("[%lu] [ERS] Cache not found, building...\n", millis()); Serial.printf("[%lu] [ERS] Cache not found, building...\n", millis());
{ {

View File

@ -129,8 +129,7 @@ void FileSelectionScreen::render() const {
renderer.drawCenteredText(READER_FONT_ID, 10, "CrossPoint Reader", true, BOLD); renderer.drawCenteredText(READER_FONT_ID, 10, "CrossPoint Reader", true, BOLD);
// Help text // Help text
renderer.drawText(SMALL_FONT_ID, 20, GfxRenderer::getScreenHeight() - 30, renderer.drawText(SMALL_FONT_ID, 20, GfxRenderer::getScreenHeight() - 30, "Press BACK for Settings");
"Press BACK for Settings");
if (files.empty()) { if (files.empty()) {
renderer.drawText(UI_FONT_ID, 20, 60, "No EPUBs found"); renderer.drawText(UI_FONT_ID, 20, 60, "No EPUBs found");

View File

@ -9,8 +9,7 @@
const SettingInfo SettingsScreen::settingsList[SettingsScreen::settingsCount] = { const SettingInfo SettingsScreen::settingsList[SettingsScreen::settingsCount] = {
{"White Sleep Screen", &CrossPointSettings::whiteSleepScreen}, {"White Sleep Screen", &CrossPointSettings::whiteSleepScreen},
{"Extra Paragraph Spacing", &CrossPointSettings::extraParagraphSpacing} {"Extra Paragraph Spacing", &CrossPointSettings::extraParagraphSpacing}};
};
void SettingsScreen::taskTrampoline(void* param) { void SettingsScreen::taskTrampoline(void* param) {
auto* self = static_cast<SettingsScreen*>(param); auto* self = static_cast<SettingsScreen*>(param);
@ -20,8 +19,6 @@ void SettingsScreen::taskTrampoline(void* param) {
void SettingsScreen::onEnter() { void SettingsScreen::onEnter() {
renderingMutex = xSemaphoreCreateMutex(); renderingMutex = xSemaphoreCreateMutex();
// Reset selection to first item // Reset selection to first item
selectedSettingIndex = 0; selectedSettingIndex = 0;
@ -135,8 +132,7 @@ void SettingsScreen::render() const {
} }
// Draw help text // Draw help text
renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 30, renderer.drawText(SMALL_FONT_ID, 20, pageHeight - 30, "Press OK to toggle, BACK to save & exit");
"Press OK to toggle, BACK to save & exit");
// Always use standard refresh for settings screen // Always use standard refresh for settings screen
renderer.displayBuffer(); renderer.displayBuffer();

View File

@ -1,9 +1,9 @@
#pragma once #pragma once
#include <cstdint>
#include <freertos/FreeRTOS.h> #include <freertos/FreeRTOS.h>
#include <freertos/semphr.h> #include <freertos/semphr.h>
#include <freertos/task.h> #include <freertos/task.h>
#include <cstdint>
#include <string> #include <string>
#include <vector> #include <vector>
@ -34,8 +34,7 @@ class SettingsScreen final : public Screen {
void toggleCurrentSetting(); void toggleCurrentSetting();
public: public:
explicit SettingsScreen(GfxRenderer& renderer, InputManager& inputManager, explicit SettingsScreen(GfxRenderer& renderer, InputManager& inputManager, const std::function<void()>& onGoHome)
const std::function<void()>& onGoHome)
: Screen(renderer, inputManager), onGoHome(onGoHome) {} : Screen(renderer, inputManager), onGoHome(onGoHome) {}
void onEnter() override; void onEnter() override;
void onExit() override; void onExit() override;

View File

@ -2,9 +2,9 @@
#include <GfxRenderer.h> #include <GfxRenderer.h>
#include "CrossPointSettings.h"
#include "config.h" #include "config.h"
#include "images/CrossLarge.h" #include "images/CrossLarge.h"
#include "CrossPointSettings.h"
void SleepScreen::onEnter() { void SleepScreen::onEnter() {
const auto pageWidth = GfxRenderer::getScreenWidth(); const auto pageWidth = GfxRenderer::getScreenWidth();