mirror of
https://github.com/esphome/esphome.git
synced 2024-11-25 12:15:33 +01:00
Remove unused item_padding
This commit is contained in:
parent
46285b20f8
commit
d663e453a1
@ -19,7 +19,6 @@ class TextPanel : public LayoutItem {
|
|||||||
void render_internal(display::Display *display, display::Rect bounds) override;
|
void render_internal(display::Display *display, display::Rect bounds) override;
|
||||||
void dump_config(int indent_depth, int additional_level_depth) 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; };
|
template<typename V> void set_text(V text) { this->text_ = text; };
|
||||||
void set_font(display::BaseFont *font) { this->font_ = font; };
|
void set_font(display::BaseFont *font) { this->font_ = font; };
|
||||||
void set_foreground_color(Color foreground_color) { this->foreground_color_ = foreground_color; };
|
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; };
|
void set_text_align(display::TextAlign text_align) { this->text_align_ = text_align; };
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
int item_padding_{0};
|
|
||||||
TemplatableValue<std::string> text_{};
|
TemplatableValue<std::string> text_{};
|
||||||
display::BaseFont *font_{nullptr};
|
display::BaseFont *font_{nullptr};
|
||||||
display::TextAlign text_align_{display::TextAlign::TOP_LEFT};
|
display::TextAlign text_align_{display::TextAlign::TOP_LEFT};
|
||||||
|
@ -7,7 +7,6 @@ graphical_layout_ns = cg.esphome_ns.namespace("graphical_layout")
|
|||||||
TextPanel = graphical_layout_ns.class_("TextPanel")
|
TextPanel = graphical_layout_ns.class_("TextPanel")
|
||||||
TextAlign = display_ns.enum("TextAlign", is_class=True)
|
TextAlign = display_ns.enum("TextAlign", is_class=True)
|
||||||
|
|
||||||
CONF_ITEM_PADDING = "item_padding"
|
|
||||||
CONF_TEXT_PANEL = "text_panel"
|
CONF_TEXT_PANEL = "text_panel"
|
||||||
CONF_FONT = "font"
|
CONF_FONT = "font"
|
||||||
CONF_FOREGROUND_COLOR = "foreground_color"
|
CONF_FOREGROUND_COLOR = "foreground_color"
|
||||||
@ -36,7 +35,6 @@ def get_config_schema(base_item_schema, item_type_schema):
|
|||||||
return base_item_schema.extend(
|
return base_item_schema.extend(
|
||||||
{
|
{
|
||||||
cv.GenerateID(): cv.declare_id(TextPanel),
|
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.Required(CONF_FONT): cv.use_id(font.Font),
|
||||||
cv.Optional(CONF_FOREGROUND_COLOR): cv.use_id(color.ColorStruct),
|
cv.Optional(CONF_FOREGROUND_COLOR): cv.use_id(color.ColorStruct),
|
||||||
cv.Optional(CONF_BACKGROUND_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):
|
async def config_to_layout_item(pvariable_builder, item_config, child_item_builder):
|
||||||
var = await pvariable_builder(item_config)
|
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])
|
panel_font = await cg.get_variable(item_config[CONF_FONT])
|
||||||
cg.add(var.set_font(panel_font))
|
cg.add(var.set_font(panel_font))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user