From a0732c3aa32d200bf154d486df3c9f506161954f Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 4 Mar 2022 21:21:15 +0800 Subject: ... --- include/cru/ui/controls/TextBlock.h | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'include/cru/ui/controls/TextBlock.h') diff --git a/include/cru/ui/controls/TextBlock.h b/include/cru/ui/controls/TextBlock.h index e43d472f..12c9d2f9 100644 --- a/include/cru/ui/controls/TextBlock.h +++ b/include/cru/ui/controls/TextBlock.h @@ -2,12 +2,17 @@ #include "NoChildControl.h" #include "../render/TextRenderObject.h" +#include "IContentBrushControl.h" +#include "IFontControl.h" #include "TextHostControlService.h" #include "cru/platform/graphics/Brush.h" +#include "cru/platform/graphics/Font.h" namespace cru::ui::controls { class CRU_UI_API TextBlock : public NoChildControl, - public virtual ITextHostControl { + public virtual ITextHostControl, + public virtual IFontControl, + public virtual IContentBrushControl { public: static constexpr StringView kControlType = u"TextBlock"; @@ -47,6 +52,22 @@ class CRU_UI_API TextBlock : public NoChildControl, return nullptr; } + std::shared_ptr GetFont() const override { + return text_render_object_->GetFont(); + } + void SetFont(std::shared_ptr font) override { + text_render_object_->SetFont(std::move(font)); + } + + std::shared_ptr GetContentBrush() const override { + return GetTextBrush(); + } + + void SetContentBrush( + std::shared_ptr brush) override { + SetTextBrush(std::move(brush)); + } + private: std::unique_ptr text_render_object_; -- cgit v1.2.3