Settings Screen and first 2 settings (#18)
* white sleep screen * quicker pwr button * no extra spacing between paragraphs * Added settings class with de/serialization and whiteSleepScreen setting to control inverting the sleep screen * Added Settings screen for real, made settings a global singleton * Added setting for extra paragraph spacing. * fixed typo * Rework after feedback * Fixed type from bool to uint8
This commit is contained in:
36
src/CrossPointSettings.h
Normal file
36
src/CrossPointSettings.h
Normal file
@@ -0,0 +1,36 @@
|
||||
#pragma once
|
||||
#include <cstdint>
|
||||
#include <iosfwd>
|
||||
|
||||
class CrossPointSettings {
|
||||
private:
|
||||
// Private constructor for singleton
|
||||
CrossPointSettings() = default;
|
||||
|
||||
// Static instance
|
||||
static CrossPointSettings instance;
|
||||
|
||||
public:
|
||||
// Delete copy constructor and assignment
|
||||
CrossPointSettings(const CrossPointSettings&) = delete;
|
||||
CrossPointSettings& operator=(const CrossPointSettings&) = delete;
|
||||
|
||||
// Sleep screen settings
|
||||
uint8_t whiteSleepScreen = 0;
|
||||
|
||||
// Text rendering settings
|
||||
uint8_t extraParagraphSpacing = 1;
|
||||
|
||||
~CrossPointSettings() = default;
|
||||
|
||||
// Get singleton instance
|
||||
static CrossPointSettings& getInstance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
bool saveToFile() const;
|
||||
bool loadFromFile();
|
||||
};
|
||||
|
||||
// Helper macro to access settings
|
||||
#define SETTINGS CrossPointSettings::getInstance()
|
||||
Reference in New Issue
Block a user