... more clang fixes

This commit is contained in:
Michael Davidson 2023-12-17 22:28:58 +11:00
parent fc6aa95ac4
commit a61343e8ec
No known key found for this signature in database
GPG Key ID: B8D1A99712B8B0EB
7 changed files with 14 additions and 19 deletions

View File

@ -10,8 +10,8 @@ class Point {
int16_t x;
int16_t y;
Point() : x(VALUE_NO_SET), y(VALUE_NO_SET) {};
inline Point(int16_t x, int16_t y) ALWAYS_INLINE : x(x), y(y) {};
Point() : x(VALUE_NO_SET), y(VALUE_NO_SET){};
inline Point(int16_t x, int16_t y) ALWAYS_INLINE : x(x), y(y){};
};
} // namespace display

View File

@ -6,16 +6,15 @@ namespace esphome {
namespace display {
class Display;
class Rect;
}
} // namespace display
namespace graphical_layout {
/** The ContainerLayoutItem can be used to derive from when a layout item has children.
* It does not define what or how child items get used just that they exist for the item
*/
*/
class ContainerLayoutItem : public LayoutItem {
public:
/** Adds an item to this container */
void add_item(LayoutItem *child) { this->children_.push_back(child); }
@ -23,5 +22,5 @@ class ContainerLayoutItem : public LayoutItem {
std::vector<LayoutItem *> children_;
};
}
}
} // namespace graphical_layout
} // namespace esphome

View File

@ -8,8 +8,7 @@ namespace graphical_layout {
static const char *const TAG = "rootlayoutcomponent";
void RootLayoutComponent::setup() {
}
void RootLayoutComponent::setup() {}
void RootLayoutComponent::dump_config() {
ESP_LOGCONFIG(TAG, "Graphical Layout");

View File

@ -16,7 +16,7 @@ namespace graphical_layout {
/** Component used for rendering the layout*/
class RootLayoutComponent : public Component {
public:
public:
void setup() override;
void dump_config() override;
@ -30,7 +30,7 @@ public:
void set_layout_root(LayoutItem *layout) { this->layout_root_ = layout; };
protected:
protected:
LayoutItem *layout_root_{nullptr};
};

View File

@ -4,14 +4,13 @@ namespace esphome {
namespace display {
class Display;
class Rect;
}
} // namespace display
namespace graphical_layout {
/** LayoutItem is the base from which all items derive from*/
class LayoutItem {
public:
/** Measures the item as it would be drawn on the display and returns the bounds for it
*
* param[in] display: Display that will be used for rendering. May be used to help with calculations

View File

@ -3,7 +3,6 @@
#include "esphome/components/graphical_layout/graphical_layout.h"
#include "esphome/components/font/font.h"
namespace esphome {
namespace graphical_layout {
@ -23,7 +22,6 @@ class TextPanel : public LayoutItem {
void set_foreground_color(Color foreground_color) { this->foreground_color_ = foreground_color; };
void set_background_color(Color background_color) { this->background_color_ = background_color; };
protected:
int item_padding_{0};
std::string text_{};