diff options
author | crupest <crupest@outlook.com> | 2020-12-25 15:38:18 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-12-25 15:38:18 +0800 |
commit | da7ad0ff5c5b158be69c6cf9a2c8e9fc9ef2b3cb (patch) | |
tree | 9d58ba66119f5a1f6efa5a9b75c22e0453993a07 /include/cru/ui/controls/TextBlock.hpp | |
parent | a14704fbd9b9fb377b7009a9fbe641a9b8d0fdfb (diff) | |
download | cru-da7ad0ff5c5b158be69c6cf9a2c8e9fc9ef2b3cb.tar.gz cru-da7ad0ff5c5b158be69c6cf9a2c8e9fc9ef2b3cb.tar.bz2 cru-da7ad0ff5c5b158be69c6cf9a2c8e9fc9ef2b3cb.zip |
...
Diffstat (limited to 'include/cru/ui/controls/TextBlock.hpp')
-rw-r--r-- | include/cru/ui/controls/TextBlock.hpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/include/cru/ui/controls/TextBlock.hpp b/include/cru/ui/controls/TextBlock.hpp index 66ebe476..be31816c 100644 --- a/include/cru/ui/controls/TextBlock.hpp +++ b/include/cru/ui/controls/TextBlock.hpp @@ -1,11 +1,10 @@ #pragma once #include "NoChildControl.hpp" -namespace cru::ui::controls { -template <typename TControl> -class TextControlService; +#include "TextHostControlService.hpp" -class TextBlock : public NoChildControl { +namespace cru::ui::controls { +class TextBlock : public NoChildControl, public virtual ITextHostControl { public: static constexpr std::u16string_view control_type = u"TextBlock"; @@ -32,12 +31,14 @@ class TextBlock : public NoChildControl { bool IsSelectable() const; void SetSelectable(bool value); - gsl::not_null<render::TextRenderObject*> GetTextRenderObject(); - render::ScrollRenderObject* GetScrollRenderObject() { return nullptr; } + gsl::not_null<render::TextRenderObject*> GetTextRenderObject() override; + render::ScrollRenderObject* GetScrollRenderObject() override { + return nullptr; + } private: std::unique_ptr<render::TextRenderObject> text_render_object_; - std::unique_ptr<TextControlService<TextBlock>> service_; + std::unique_ptr<TextHostControlService> service_; }; } // namespace cru::ui::controls |