diff options
author | crupest <crupest@outlook.com> | 2022-02-14 23:03:35 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2022-02-14 23:03:35 +0800 |
commit | ab80b32dc6acd7fdfd1da3b63d69535264af0ef3 (patch) | |
tree | 2bf8bb570c0093981cfc8f4a9ec71bdae2c277cf | |
parent | 21c1c3281cd4186d9810d68122e9e8e92da714ad (diff) | |
download | cru-ab80b32dc6acd7fdfd1da3b63d69535264af0ef3.tar.gz cru-ab80b32dc6acd7fdfd1da3b63d69535264af0ef3.tar.bz2 cru-ab80b32dc6acd7fdfd1da3b63d69535264af0ef3.zip |
...
-rw-r--r-- | src/theme_builder/components/conditions/ConditionEditor.cpp | 10 | ||||
-rw-r--r-- | src/theme_builder/components/conditions/ConditionEditor.h | 11 |
2 files changed, 18 insertions, 3 deletions
diff --git a/src/theme_builder/components/conditions/ConditionEditor.cpp b/src/theme_builder/components/conditions/ConditionEditor.cpp index d50a1d6b..772fcc98 100644 --- a/src/theme_builder/components/conditions/ConditionEditor.cpp +++ b/src/theme_builder/components/conditions/ConditionEditor.cpp @@ -1 +1,11 @@ #include "ConditionEditor.h" +#include "cru/ui/controls/FlexLayout.h" + +namespace cru::theme_builder::components::conditions { +ConditionEditor::ConditionEditor() { + container_.SetFlexDirection(ui::controls::FlexDirection::Vertical); + container_.AddChild(&label_); +} + +ConditionEditor::~ConditionEditor() { container_.RemoveFromParent(); } +} // namespace cru::theme_builder::components::conditions diff --git a/src/theme_builder/components/conditions/ConditionEditor.h b/src/theme_builder/components/conditions/ConditionEditor.h index ddca5e28..0bbaa6ed 100644 --- a/src/theme_builder/components/conditions/ConditionEditor.h +++ b/src/theme_builder/components/conditions/ConditionEditor.h @@ -3,7 +3,7 @@ #include "cru/ui/controls/FlexLayout.h" #include "cru/ui/controls/TextBlock.h" -namespace cru::theme_builder { +namespace cru::theme_builder::components::conditions { class ConditionEditor : public ui::components::Component { public: ConditionEditor(); @@ -11,10 +11,15 @@ class ConditionEditor : public ui::components::Component { ~ConditionEditor() override; public: - ui::controls::Control* GetRootControl() override { return nullptr; } + ui::controls::Control* GetRootControl() override { return &container_; } + + ui::controls::FlexLayout* GetContainer() { return &container_; } + + String GetLabel() const { return label_.GetText(); } + void SetLabel(String label) { label_.SetText(std::move(label)); } private: ui::controls::FlexLayout container_; ui::controls::TextBlock label_; }; -} // namespace cru::theme_builder +} // namespace cru::theme_builder::components::conditions |