aboutsummaryrefslogtreecommitdiff
path: root/src/theme_builder/components/stylers/StylerEditor.h
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-16 20:22:25 +0800
committercrupest <crupest@outlook.com>2022-02-16 20:22:25 +0800
commit3cd44092c44651650a760752a3d374f610ca4f77 (patch)
treed3481e8d93d8d47674d0df46eb765ccf9100bca8 /src/theme_builder/components/stylers/StylerEditor.h
parent6459edc7c8af9e5c9bafe4f1635194334f42f415 (diff)
downloadcru-3cd44092c44651650a760752a3d374f610ca4f77.tar.gz
cru-3cd44092c44651650a760752a3d374f610ca4f77.tar.bz2
cru-3cd44092c44651650a760752a3d374f610ca4f77.zip
...
Diffstat (limited to 'src/theme_builder/components/stylers/StylerEditor.h')
-rw-r--r--src/theme_builder/components/stylers/StylerEditor.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/theme_builder/components/stylers/StylerEditor.h b/src/theme_builder/components/stylers/StylerEditor.h
new file mode 100644
index 00000000..6da0f6fa
--- /dev/null
+++ b/src/theme_builder/components/stylers/StylerEditor.h
@@ -0,0 +1,29 @@
+#pragma once
+#include "cru/ui/components/Component.h"
+#include "cru/ui/controls/FlexLayout.h"
+#include "cru/ui/controls/TextBlock.h"
+#include "cru/ui/style/Styler.h"
+
+namespace cru::theme_builder::components::stylers {
+class StylerEditor : public ui::components::Component {
+ public:
+ StylerEditor();
+ ~StylerEditor() override;
+
+ public:
+ 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)); }
+
+ virtual ClonablePtr<ui::style::Styler> GetStyler() = 0;
+
+ private:
+ ui::controls::FlexLayout container_;
+ ui::controls::TextBlock label_;
+};
+
+std::unique_ptr<StylerEditor> CreateStylerEditor(ui::style::Styler* styler);
+} // namespace cru::theme_builder::components::stylers