Remove unused item_padding

This commit is contained in:
Michael Davidson 2023-12-27 10:51:59 +11:00
parent 46285b20f8
commit d663e453a1
No known key found for this signature in database
GPG key ID: B8D1A99712B8B0EB
2 changed files with 0 additions and 7 deletions

View file

@ -19,7 +19,6 @@ class TextPanel : public LayoutItem {
void render_internal(display::Display *display, display::Rect bounds) override;
void dump_config(int indent_depth, int additional_level_depth) override;
void set_item_padding(int item_padding) { this->item_padding_ = item_padding; };
template<typename V> void set_text(V text) { this->text_ = text; };
void set_font(display::BaseFont *font) { this->font_ = font; };
void set_foreground_color(Color foreground_color) { this->foreground_color_ = foreground_color; };
@ -27,7 +26,6 @@ class TextPanel : public LayoutItem {
void set_text_align(display::TextAlign text_align) { this->text_align_ = text_align; };
protected:
int item_padding_{0};
TemplatableValue<std::string> text_{};
display::BaseFont *font_{nullptr};
display::TextAlign text_align_{display::TextAlign::TOP_LEFT};

View file

@ -7,7 +7,6 @@ graphical_layout_ns = cg.esphome_ns.namespace("graphical_layout")
TextPanel = graphical_layout_ns.class_("TextPanel")
TextAlign = display_ns.enum("TextAlign", is_class=True)
CONF_ITEM_PADDING = "item_padding"
CONF_TEXT_PANEL = "text_panel"
CONF_FONT = "font"
CONF_FOREGROUND_COLOR = "foreground_color"
@ -36,7 +35,6 @@ def get_config_schema(base_item_schema, item_type_schema):
return base_item_schema.extend(
{
cv.GenerateID(): cv.declare_id(TextPanel),
cv.Optional(CONF_ITEM_PADDING, default=0): cv.int_,
cv.Required(CONF_FONT): cv.use_id(font.Font),
cv.Optional(CONF_FOREGROUND_COLOR): cv.use_id(color.ColorStruct),
cv.Optional(CONF_BACKGROUND_COLOR): cv.use_id(color.ColorStruct),
@ -49,9 +47,6 @@ def get_config_schema(base_item_schema, item_type_schema):
async def config_to_layout_item(pvariable_builder, item_config, child_item_builder):
var = await pvariable_builder(item_config)
if item_padding_config := item_config[CONF_ITEM_PADDING]:
cg.add(var.set_item_padding(item_padding_config))
panel_font = await cg.get_variable(item_config[CONF_FONT])
cg.add(var.set_font(panel_font))