knxdisplay/main/widgets/LabelWidget.hpp
2026-01-29 19:33:12 +01:00

26 lines
650 B
C++

#pragma once
#include "Widget.hpp"
class LabelWidget : public Widget {
public:
explicit LabelWidget(const WidgetConfig& config);
lv_obj_t* create(lv_obj_t* parent) override;
void applyStyle() override;
// KNX updates
void onKnxValue(float value) override;
void onKnxSwitch(bool value) override;
void onKnxText(const char* text) override;
void onKnxTime(const struct tm& value, TextSource source) override;
private:
lv_obj_t* container_ = nullptr;
lv_obj_t* textLabel_ = nullptr;
lv_obj_t* iconLabel_ = nullptr;
void setupFlexLayout();
static int encodeUtf8(uint32_t codepoint, char* buf);
};