mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-06 15:47:39 +03:00
fix(cppcheck): clang format
This commit is contained in:
parent
bd28d9d648
commit
5e9e53cc13
@ -298,15 +298,15 @@ class Badge : public UIElement {
|
|||||||
// Fully themable toggle with track and knob
|
// Fully themable toggle with track and knob
|
||||||
// Supports rounded or square appearance based on BorderRadius
|
// Supports rounded or square appearance based on BorderRadius
|
||||||
class Toggle : public UIElement {
|
class Toggle : public UIElement {
|
||||||
Expression valueExpr; // Boolean expression for on/off state
|
Expression valueExpr; // Boolean expression for on/off state
|
||||||
Expression onColorExpr; // Track color when ON
|
Expression onColorExpr; // Track color when ON
|
||||||
Expression offColorExpr; // Track color when OFF
|
Expression offColorExpr; // Track color when OFF
|
||||||
Expression knobColorExpr; // Knob color (optional, defaults to opposite of track)
|
Expression knobColorExpr; // Knob color (optional, defaults to opposite of track)
|
||||||
int trackWidth = 44;
|
int trackWidth = 44;
|
||||||
int trackHeight = 24;
|
int trackHeight = 24;
|
||||||
int knobSize = 20;
|
int knobSize = 20;
|
||||||
int borderRadius = 0; // 0 = square, >0 = rounded (use trackHeight/2 for pill shape)
|
int borderRadius = 0; // 0 = square, >0 = rounded (use trackHeight/2 for pill shape)
|
||||||
int knobRadius = 0; // Knob corner radius
|
int knobRadius = 0; // Knob corner radius
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Toggle(const std::string& id) : UIElement(id) {
|
Toggle(const std::string& id) : UIElement(id) {
|
||||||
|
|||||||
@ -294,7 +294,7 @@ void BitmapElement::draw(const GfxRenderer& renderer, const ThemeContext& contex
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3. Fallback to RAM Cache (Standard method)
|
// 3. Fallback to RAM Cache (Standard method)
|
||||||
if (!drawSuccess) {
|
if (!drawSuccess) {
|
||||||
const std::vector<uint8_t>* data = ThemeManager::get().getCachedAsset(path);
|
const std::vector<uint8_t>* data = ThemeManager::get().getCachedAsset(path);
|
||||||
if (data && !data->empty()) {
|
if (data && !data->empty()) {
|
||||||
|
|||||||
@ -56,9 +56,7 @@ UIElement* ThemeManager::createElement(const std::string& id, const std::string&
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Parse integer safely - returns 0 on error
|
// Parse integer safely - returns 0 on error
|
||||||
static int parseIntSafe(const std::string& val) {
|
static int parseIntSafe(const std::string& val) { return static_cast<int>(std::strtol(val.c_str(), nullptr, 10)); }
|
||||||
return static_cast<int>(std::strtol(val.c_str(), nullptr, 10));
|
|
||||||
}
|
|
||||||
|
|
||||||
void ThemeManager::applyProperties(UIElement* elem, const std::map<std::string, std::string>& props) {
|
void ThemeManager::applyProperties(UIElement* elem, const std::map<std::string, std::string>& props) {
|
||||||
const auto elemType = elem->getType();
|
const auto elemType = elem->getType();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user