mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 06:37:38 +03:00
style: Apply clang-format to web settings files
This commit is contained in:
parent
76bfe2d35d
commit
3834555a16
@ -33,8 +33,8 @@ inline std::vector<SettingInfo> getSettingsList() {
|
||||
SettingInfo::Enum("lineSpacing", "Line Spacing", "Reader", &CrossPointSettings::lineSpacing,
|
||||
{"Tight", "Normal", "Wide"}),
|
||||
SettingInfo::Value("screenMargin", "Screen Margin", "Reader", &CrossPointSettings::screenMargin, {5, 40, 5}),
|
||||
SettingInfo::Enum("paragraphAlignment", "Paragraph Alignment", "Reader",
|
||||
&CrossPointSettings::paragraphAlignment, {"Justify", "Left", "Center", "Right"}),
|
||||
SettingInfo::Enum("paragraphAlignment", "Paragraph Alignment", "Reader", &CrossPointSettings::paragraphAlignment,
|
||||
{"Justify", "Left", "Center", "Right"}),
|
||||
SettingInfo::Toggle("hyphenationEnabled", "Hyphenation", "Reader", &CrossPointSettings::hyphenationEnabled),
|
||||
SettingInfo::Enum("orientation", "Reading Orientation", "Reader", &CrossPointSettings::orientation,
|
||||
{"Portrait", "Landscape CW", "Inverted", "Landscape CCW"}),
|
||||
|
||||
@ -14,9 +14,9 @@ class CrossPointSettings;
|
||||
enum class SettingType { TOGGLE, ENUM, ACTION, VALUE, STRING };
|
||||
|
||||
struct SettingInfo {
|
||||
const char* key; // JSON key for web API (nullptr for ACTION types)
|
||||
const char* name; // Display name of the setting
|
||||
const char* category; // Category for grouping in web UI (nullptr = uncategorized)
|
||||
const char* key; // JSON key for web API (nullptr for ACTION types)
|
||||
const char* name; // Display name of the setting
|
||||
const char* category; // Category for grouping in web UI (nullptr = uncategorized)
|
||||
SettingType type;
|
||||
uint8_t CrossPointSettings::* valuePtr; // Pointer to member in CrossPointSettings (for TOGGLE/ENUM/VALUE)
|
||||
char* stringPtr; // Pointer to char array (for STRING type)
|
||||
@ -41,8 +41,8 @@ struct SettingInfo {
|
||||
return {key, name, category, SettingType::TOGGLE, ptr, nullptr, 0, {}, {}};
|
||||
}
|
||||
|
||||
static SettingInfo Enum(const char* key, const char* name, const char* category,
|
||||
uint8_t CrossPointSettings::* ptr, std::vector<std::string> values) {
|
||||
static SettingInfo Enum(const char* key, const char* name, const char* category, uint8_t CrossPointSettings::* ptr,
|
||||
std::vector<std::string> values) {
|
||||
return {key, name, category, SettingType::ENUM, ptr, nullptr, 0, std::move(values), {}};
|
||||
}
|
||||
|
||||
@ -50,8 +50,8 @@ struct SettingInfo {
|
||||
return {nullptr, name, nullptr, SettingType::ACTION, nullptr, nullptr, 0, {}, {}};
|
||||
}
|
||||
|
||||
static SettingInfo Value(const char* key, const char* name, const char* category,
|
||||
uint8_t CrossPointSettings::* ptr, const ValueRange valueRange) {
|
||||
static SettingInfo Value(const char* key, const char* name, const char* category, uint8_t CrossPointSettings::* ptr,
|
||||
const ValueRange valueRange) {
|
||||
return {key, name, category, SettingType::VALUE, ptr, nullptr, 0, {}, valueRange};
|
||||
}
|
||||
|
||||
@ -74,8 +74,8 @@ struct SettingInfo {
|
||||
}
|
||||
|
||||
static SettingInfo DynamicString(const char* key, const char* name, const char* category,
|
||||
std::function<std::string()> getter,
|
||||
std::function<void(const std::string&)> setter, size_t maxLen) {
|
||||
std::function<std::string()> getter, std::function<void(const std::string&)> setter,
|
||||
size_t maxLen) {
|
||||
SettingInfo info{};
|
||||
info.key = key;
|
||||
info.name = name;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user