clang fixes

This commit is contained in:
Michael Davidson 2023-12-17 21:52:56 +11:00
parent f749d26353
commit 2227a091c5
No known key found for this signature in database
GPG key ID: B8D1A99712B8B0EB
14 changed files with 72 additions and 75 deletions

View file

@ -358,7 +358,6 @@ void Display::set_local_coordinates_relative_to_current(int x_offset, int y_offs
p.y += y_offset;
this->local_coordinate_.push_back(p);
}
void Display::pop_local_coordinates() {
if (this->local_coordinate_.empty()) {

View file

@ -2,9 +2,9 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import font, color
from esphome.const import CONF_ID
from esphome.components.graphical_layout import horizontal_stack
from esphome.components.graphical_layout import vertical_stack
from esphome.components.graphical_layout import text_panel
from . import horizontal_stack
from . import vertical_stack
from . import text_panel
graphical_layout_ns = cg.esphome_ns.namespace("graphical_layout")
RootLayoutComponent = graphical_layout_ns.class_("RootLayoutComponent", cg.Component)

View file

@ -17,9 +17,7 @@ class ContainerLayoutItem : public LayoutItem {
public:
/** Adds an item to this container */
void add_item(LayoutItem *child) {
this->children_.push_back(child);
}
void add_item(LayoutItem *child) { this->children_.push_back(child); }
protected:
std::vector<LayoutItem *> children_;

View file

@ -10,7 +10,7 @@ namespace esphome {
namespace display {
class Display;
class Rect;
}
} // namespace display
namespace graphical_layout {

View file

@ -47,5 +47,5 @@ void HorizontalStack::render(display::Display *display, display::Rect bounds) {
}
}
}
}
} // namespace graphical_layout
} // namespace esphome

View file

@ -21,5 +21,5 @@ protected:
int item_padding_{0};
};
}
}
} // namespace graphical_layout
} // namespace esphome

View file

@ -33,5 +33,5 @@ class LayoutItem {
virtual void dump_config(int indent_depth, int additional_level_depth) = 0;
};
}
}
} // namespace graphical_layout
} // namespace esphome

View file

@ -19,7 +19,8 @@ const display::Rect TextPanel::measure_item(display::Display *display) {
int width;
int height;
display->get_text_bounds(0, 0, this->text_.c_str(), this->font_, display::TextAlign::TOP_LEFT, &x1, &y1, &width, &height);
display->get_text_bounds(0, 0, this->text_.c_str(), this->font_, display::TextAlign::TOP_LEFT, &x1, &y1, &width,
&height);
return display::Rect(0, 0, width, height);
}
@ -28,5 +29,5 @@ void TextPanel::render(display::Display *display, display::Rect bounds) {
display->print(0, 0, this->font_, this->foreground_color_, display::TextAlign::TOP_LEFT, this->text_.c_str());
}
}
}
} // namespace graphical_layout
} // namespace esphome

View file

@ -32,5 +32,5 @@ protected:
Color background_color_{COLOR_OFF};
};
}
}
} // namespace graphical_layout
} // namespace esphome

View file

@ -46,5 +46,5 @@ void VerticalStack::render(display::Display *display, display::Rect bounds) {
}
}
}
}
} // namespace graphical_layout
} // namespace esphome

View file

@ -3,7 +3,6 @@
#include "esphome/components/graphical_layout/graphical_layout.h"
#include "esphome/components/graphical_layout/container_layout_item.h"
namespace esphome {
namespace graphical_layout {
@ -21,5 +20,5 @@ protected:
int item_padding_{0};
};
}
}
} // namespace graphical_layout
} // namespace esphome