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:
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user