mirror of
https://github.com/esphome/esphome.git
synced 2024-12-12 08:24:55 +01:00
ci-custom and clang-format fixes
This commit is contained in:
parent
cbd4515900
commit
9e7ccebaa1
3 changed files with 7 additions and 11 deletions
|
@ -12,14 +12,14 @@ static const char *const TAG = "fixeddimensionpanel";
|
||||||
void FixedDimensionPanel::dump_config(int indent_depth, int additional_level_depth) {
|
void FixedDimensionPanel::dump_config(int indent_depth, int additional_level_depth) {
|
||||||
this->dump_config_base_properties(TAG, indent_depth);
|
this->dump_config_base_properties(TAG, indent_depth);
|
||||||
if (this->width_.value() < 0) {
|
if (this->width_.value() < 0) {
|
||||||
ESP_LOGCONFIG(TAG, "%*sWidth: UNSET (Will use %s's width)", indent_depth, "",
|
ESP_LOGCONFIG(TAG, "%*sWidth: UNSET (Will use %s's width)", indent_depth, "",
|
||||||
this->unset_width_uses_display_width_ ? "DISPLAY" : "CHILD");
|
this->unset_width_uses_display_width_ ? "DISPLAY" : "CHILD");
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGCONFIG(TAG, "%*sWidth: %i", indent_depth, "", this->width_.value());
|
ESP_LOGCONFIG(TAG, "%*sWidth: %i", indent_depth, "", this->width_.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->height_.value() < 0) {
|
if (this->height_.value() < 0) {
|
||||||
ESP_LOGCONFIG(TAG, "%*sHeight: UNSET (Will use %s's height)", indent_depth, "",
|
ESP_LOGCONFIG(TAG, "%*sHeight: UNSET (Will use %s's height)", indent_depth, "",
|
||||||
this->unset_height_uses_display_height_ ? "DISPLAY" : "CHILD");
|
this->unset_height_uses_display_height_ ? "DISPLAY" : "CHILD");
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGCONFIG(TAG, "%*sHeight: %i", indent_depth, "", this->height_.value());
|
ESP_LOGCONFIG(TAG, "%*sHeight: %i", indent_depth, "", this->height_.value());
|
||||||
|
|
|
@ -19,12 +19,8 @@ class FixedDimensionPanel : public LayoutItem {
|
||||||
template<typename V> void set_width(V width) { this->width_ = width; };
|
template<typename V> void set_width(V width) { this->width_ = width; };
|
||||||
template<typename V> void set_height(V height) { this->height_ = height; }
|
template<typename V> void set_height(V height) { this->height_ = height; }
|
||||||
|
|
||||||
void set_unset_width_uses_display_width(bool use_display) {
|
void set_unset_width_uses_display_width(bool use_display) { this->unset_width_uses_display_width_ = use_display; }
|
||||||
this->unset_width_uses_display_width_ = use_display;
|
void set_unset_height_uses_display_height(bool use_display) { this->unset_height_uses_display_height_ = use_display; }
|
||||||
}
|
|
||||||
void set_unset_height_uses_display_height(bool use_display) {
|
|
||||||
this->unset_height_uses_display_height_ = use_display;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LayoutItem *child_{nullptr};
|
LayoutItem *child_{nullptr};
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "esphome/core/color.h"
|
#include "esphome/core/color.h"
|
||||||
#include "esphome/core/log.h"
|
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
|
struct LogString;
|
||||||
namespace display {
|
namespace display {
|
||||||
class Display;
|
class Display;
|
||||||
class Rect;
|
class Rect;
|
||||||
|
@ -85,7 +85,7 @@ class LayoutItem {
|
||||||
virtual void dump_config(int indent_depth, int additional_level_depth) = 0;
|
virtual void dump_config(int indent_depth, int additional_level_depth) = 0;
|
||||||
|
|
||||||
/** Dumps the base properties of the LayoutItem. Should be called by implementors dump_config()
|
/** Dumps the base properties of the LayoutItem. Should be called by implementors dump_config()
|
||||||
*
|
*
|
||||||
* param[in] tag: Tag to pass to ESP_LOGCONFIG
|
* param[in] tag: Tag to pass to ESP_LOGCONFIG
|
||||||
* param[in] indent_depth: Depth to indent the config
|
* param[in] indent_depth: Depth to indent the config
|
||||||
*/
|
*/
|
||||||
|
@ -105,7 +105,7 @@ class LayoutItem {
|
||||||
int margin_{0};
|
int margin_{0};
|
||||||
int padding_{0};
|
int padding_{0};
|
||||||
int border_{0};
|
int border_{0};
|
||||||
Color border_color_{Color(0, 0, 0, 0)};
|
Color border_color_{Color::BLACK};
|
||||||
};
|
};
|
||||||
|
|
||||||
const LogString *horizontal_child_align_to_string(HorizontalChildAlign align);
|
const LogString *horizontal_child_align_to_string(HorizontalChildAlign align);
|
||||||
|
|
Loading…
Reference in a new issue