1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-17 15:26:01 +00:00

display: move Image, Font and Animation code into components (#4967)

* display: move `Font` to `components/font`

* display: move `Animation` to `components/animation`

* display: move `Image` to `components/image`
This commit is contained in:
Kamil Trzciński
2023-06-25 00:56:29 +02:00
committed by GitHub
parent eb145757e5
commit 8a1c49a4ae
11 changed files with 55 additions and 47 deletions

View File

@@ -1,6 +1,5 @@
#include "graph.h"
#include "esphome/components/display/display_buffer.h"
#include "esphome/components/display/font.h"
#include "esphome/core/color.h"
#include "esphome/core/log.h"
#include "esphome/core/hal.h"

View File

@@ -11,7 +11,7 @@ namespace esphome {
// forward declare DisplayBuffer
namespace display {
class DisplayBuffer;
class Font;
class BaseFont;
} // namespace display
namespace graph {
@@ -45,8 +45,8 @@ enum ValuePositionType {
class GraphLegend {
public:
void init(Graph *g);
void set_name_font(display::Font *font) { this->font_label_ = font; }
void set_value_font(display::Font *font) { this->font_value_ = font; }
void set_name_font(display::BaseFont *font) { this->font_label_ = font; }
void set_value_font(display::BaseFont *font) { this->font_value_ = font; }
void set_width(uint32_t width) { this->width_ = width; }
void set_height(uint32_t height) { this->height_ = height; }
void set_border(bool val) { this->border_ = val; }
@@ -63,8 +63,8 @@ class GraphLegend {
ValuePositionType values_{VALUE_POSITION_TYPE_AUTO};
bool units_{true};
DirectionType direction_{DIRECTION_TYPE_AUTO};
display::Font *font_label_{nullptr};
display::Font *font_value_{nullptr};
display::BaseFont *font_label_{nullptr};
display::BaseFont *font_value_{nullptr};
// Calculated values
Graph *parent_{nullptr};
// (x0) (xs,ys) (xs,ys)