From 34a64e6ffefaab007578932ddbab931a25f1d56e Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 15 May 2022 14:15:31 +0800 Subject: ... --- .../components/properties/FontPropertyEditor.h | 38 ++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 src/ThemeBuilder/components/properties/FontPropertyEditor.h (limited to 'src/ThemeBuilder/components/properties/FontPropertyEditor.h') diff --git a/src/ThemeBuilder/components/properties/FontPropertyEditor.h b/src/ThemeBuilder/components/properties/FontPropertyEditor.h new file mode 100644 index 00000000..d349f1f2 --- /dev/null +++ b/src/ThemeBuilder/components/properties/FontPropertyEditor.h @@ -0,0 +1,38 @@ +#pragma once +#include "../Editor.h" +#include "cru/platform/graphics/Font.h" +#include "cru/ui/components/Input.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; + + 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 GetValue() const; + void SetValue(std::shared_ptr 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::components::FloatInput font_size_input_; +}; +} // namespace cru::theme_builder::components::properties -- cgit v1.2.3