From 5e9e53cc13f1c6c1182761ce4b6d51e57e30849b Mon Sep 17 00:00:00 2001 From: Brackyt <60280126+Brackyt@users.noreply.github.com> Date: Tue, 27 Jan 2026 23:51:18 +0100 Subject: [PATCH] fix(cppcheck): clang format --- lib/ThemeEngine/include/LayoutElements.h | 12 ++++++------ lib/ThemeEngine/src/BasicElements.cpp | 4 ++-- lib/ThemeEngine/src/ThemeManager.cpp | 4 +--- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/lib/ThemeEngine/include/LayoutElements.h b/lib/ThemeEngine/include/LayoutElements.h index d2a59f7f..2aa686a5 100644 --- a/lib/ThemeEngine/include/LayoutElements.h +++ b/lib/ThemeEngine/include/LayoutElements.h @@ -298,15 +298,15 @@ class Badge : public UIElement { // Fully themable toggle with track and knob // Supports rounded or square appearance based on BorderRadius class Toggle : public UIElement { - Expression valueExpr; // Boolean expression for on/off state - Expression onColorExpr; // Track color when ON - Expression offColorExpr; // Track color when OFF - Expression knobColorExpr; // Knob color (optional, defaults to opposite of track) + Expression valueExpr; // Boolean expression for on/off state + Expression onColorExpr; // Track color when ON + Expression offColorExpr; // Track color when OFF + Expression knobColorExpr; // Knob color (optional, defaults to opposite of track) int trackWidth = 44; int trackHeight = 24; int knobSize = 20; - int borderRadius = 0; // 0 = square, >0 = rounded (use trackHeight/2 for pill shape) - int knobRadius = 0; // Knob corner radius + int borderRadius = 0; // 0 = square, >0 = rounded (use trackHeight/2 for pill shape) + int knobRadius = 0; // Knob corner radius public: Toggle(const std::string& id) : UIElement(id) { diff --git a/lib/ThemeEngine/src/BasicElements.cpp b/lib/ThemeEngine/src/BasicElements.cpp index c6513fb4..0c64af70 100644 --- a/lib/ThemeEngine/src/BasicElements.cpp +++ b/lib/ThemeEngine/src/BasicElements.cpp @@ -117,7 +117,7 @@ void Label::draw(const GfxRenderer& renderer, const ThemeContext& context) { markClean(); return; } - + std::string colStr = context.evaluatestring(colorExpr); uint8_t color = Color::parse(colStr).value; bool black = (color == 0x00); @@ -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) { const std::vector* data = ThemeManager::get().getCachedAsset(path); if (data && !data->empty()) { diff --git a/lib/ThemeEngine/src/ThemeManager.cpp b/lib/ThemeEngine/src/ThemeManager.cpp index 0330e330..30431e3e 100644 --- a/lib/ThemeEngine/src/ThemeManager.cpp +++ b/lib/ThemeEngine/src/ThemeManager.cpp @@ -56,9 +56,7 @@ UIElement* ThemeManager::createElement(const std::string& id, const std::string& } // Parse integer safely - returns 0 on error -static int parseIntSafe(const std::string& val) { - return static_cast(std::strtol(val.c_str(), nullptr, 10)); -} +static int parseIntSafe(const std::string& val) { return static_cast(std::strtol(val.c_str(), nullptr, 10)); } void ThemeManager::applyProperties(UIElement* elem, const std::map& props) { const auto elemType = elem->getType();