diff options
author | crupest <crupest@outlook.com> | 2020-03-18 22:57:08 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2020-03-18 22:57:08 +0800 |
commit | c5a4f8c11d0d84d85359e5ff03477da5e9f12926 (patch) | |
tree | 47122aa3c07ecc536ca387f416de1179c8203329 /include/cru/ui/controls/text_block.hpp | |
parent | bfd277f9f621931a1c6ea05ea2cd6d04455cfe67 (diff) | |
download | cru-c5a4f8c11d0d84d85359e5ff03477da5e9f12926.tar.gz cru-c5a4f8c11d0d84d85359e5ff03477da5e9f12926.tar.bz2 cru-c5a4f8c11d0d84d85359e5ff03477da5e9f12926.zip |
...
Diffstat (limited to 'include/cru/ui/controls/text_block.hpp')
-rw-r--r-- | include/cru/ui/controls/text_block.hpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/include/cru/ui/controls/text_block.hpp b/include/cru/ui/controls/text_block.hpp index db0fb4e5..701f946f 100644 --- a/include/cru/ui/controls/text_block.hpp +++ b/include/cru/ui/controls/text_block.hpp @@ -1,10 +1,11 @@ #pragma once #include "../no_child_control.hpp" -#include "text_common.hpp" - namespace cru::ui::controls { -class TextBlock : public NoChildControl, public virtual ITextControl { +template <typename TControl> +class TextControlService; + +class TextBlock : public NoChildControl { public: static constexpr std::string_view control_type = "TextBlock"; @@ -27,9 +28,9 @@ class TextBlock : public NoChildControl, public virtual ITextControl { std::string GetText() const; void SetText(std::string text); - render::TextRenderObject* GetTextRenderObject() override; - render::CanvasRenderObject* GetCaretRenderObject() override; - platform::graph::IBrush* GetCaretBrush() override; + render::TextRenderObject* GetTextRenderObject(); + render::CanvasRenderObject* GetCaretRenderObject(); + platform::graph::IBrush* GetCaretBrush(); private: std::unique_ptr<render::StackLayoutRenderObject> root_render_object_; @@ -37,6 +38,6 @@ class TextBlock : public NoChildControl, public virtual ITextControl { std::unique_ptr<render::CanvasRenderObject> caret_render_object_; std::shared_ptr<platform::graph::IBrush> caret_brush_; - std::unique_ptr<TextControlService> service_; + std::unique_ptr<TextControlService<TextBlock>> service_; }; } // namespace cru::ui::controls |