diff options
| author | crupest <crupest@outlook.com> | 2022-03-09 23:18:31 +0800 |
|---|---|---|
| committer | crupest <crupest@outlook.com> | 2022-03-09 23:18:31 +0800 |
| commit | 268bec4cd0d562394c2c27d10a26be1264bc8648 (patch) | |
| tree | b8398c35e3b51aa3b91c75612bb46da0a0f2845f /src/theme_builder/components/properties/FontPropertyEditor.h | |
| parent | dceef749139061fdac4946df77219f1cc8aa6483 (diff) | |
| download | cru-268bec4cd0d562394c2c27d10a26be1264bc8648.tar.gz cru-268bec4cd0d562394c2c27d10a26be1264bc8648.tar.bz2 cru-268bec4cd0d562394c2c27d10a26be1264bc8648.zip | |
...
Diffstat (limited to 'src/theme_builder/components/properties/FontPropertyEditor.h')
| -rw-r--r-- | src/theme_builder/components/properties/FontPropertyEditor.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/theme_builder/components/properties/FontPropertyEditor.h b/src/theme_builder/components/properties/FontPropertyEditor.h new file mode 100644 index 00000000..f7dd0362 --- /dev/null +++ b/src/theme_builder/components/properties/FontPropertyEditor.h @@ -0,0 +1,37 @@ +#pragma once +#include "../Editor.h" +#include "cru/platform/graphics/Font.h" +#include "cru/ui/controls/Control.h" +#include "cru/ui/controls/FlexLayout.h" +#include "cru/ui/controls/TextBlock.h" +#include "cru/ui/controls/TextBox.h" + +namespace cru::theme_builder::components::properties { +class FontPropertyEditor : public Editor { + public: + using PropertyType = std::shared_ptr<platform::graphics::IFont>; + + FontPropertyEditor(); + ~FontPropertyEditor() override; + + ui::controls::Control* GetRootControl() override; + + String GetLabelText() const { return label_.GetText(); } + void SetLabelText(String label) { label_.SetText(std::move(label)); } + + std::shared_ptr<platform::graphics::IFont> GetValue() const; + void SetValue(std::shared_ptr<platform::graphics::IFont> value, + bool trigger_change = true); + + private: + ui::controls::FlexLayout main_container_; + ui::controls::TextBlock label_; + ui::controls::FlexLayout right_container_; + ui::controls::FlexLayout font_family_container_; + ui::controls::TextBlock font_family_label_; + ui::controls::TextBox font_family_text_; + ui::controls::FlexLayout font_size_container_; + ui::controls::TextBlock font_size_label_; + ui::controls::TextBox font_size_text_; +}; +} // namespace cru::theme_builder::components::properties |
