mirror of
https://github.com/esphome/esphome.git
synced 2026-08-22 22:26:21 +00:00
[display] Inline the trivial DisplayPage setters and page navigation helpers
This commit is contained in:
@@ -685,9 +685,6 @@ void Display::show_page(DisplayPage *page) {
|
||||
}
|
||||
}
|
||||
|
||||
void Display::show_next_page() { this->page_->show_next(); }
|
||||
void Display::show_prev_page() { this->page_->show_prev(); }
|
||||
|
||||
void Display::do_update_() {
|
||||
if (this->auto_clear_enabled_) {
|
||||
this->clear();
|
||||
@@ -892,9 +889,6 @@ void DisplayPage::show_prev() {
|
||||
this->prev_->show();
|
||||
}
|
||||
|
||||
void DisplayPage::set_parent(Display *parent) { this->parent_ = parent; }
|
||||
void DisplayPage::set_prev(DisplayPage *prev) { this->prev_ = prev; }
|
||||
void DisplayPage::set_next(DisplayPage *next) { this->next_ = next; }
|
||||
const display_writer_t &DisplayPage::get_writer() const { return this->writer_; }
|
||||
|
||||
const LogString *text_align_to_string(TextAlign textalign) {
|
||||
|
||||
@@ -802,9 +802,9 @@ class DisplayPage final {
|
||||
void show();
|
||||
void show_next();
|
||||
void show_prev();
|
||||
void set_parent(Display *parent);
|
||||
void set_prev(DisplayPage *prev);
|
||||
void set_next(DisplayPage *next);
|
||||
void set_parent(Display *parent) { this->parent_ = parent; }
|
||||
void set_prev(DisplayPage *prev) { this->prev_ = prev; }
|
||||
void set_next(DisplayPage *next) { this->next_ = next; }
|
||||
const display_writer_t &get_writer() const;
|
||||
|
||||
protected:
|
||||
@@ -814,6 +814,9 @@ class DisplayPage final {
|
||||
DisplayPage *next_{nullptr};
|
||||
};
|
||||
|
||||
inline void Display::show_next_page() { this->page_->show_next(); }
|
||||
inline void Display::show_prev_page() { this->page_->show_prev(); }
|
||||
|
||||
template<typename... Ts> class DisplayPageShowAction final : public Action<Ts...> {
|
||||
public:
|
||||
TEMPLATABLE_VALUE(DisplayPage *, page)
|
||||
|
||||
Reference in New Issue
Block a user