aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls/TextBlock.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/cru/ui/controls/TextBlock.h')
-rw-r--r--include/cru/ui/controls/TextBlock.h23
1 files changed, 22 insertions, 1 deletions
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<platform::graphics::IFont> GetFont() const override {
+ return text_render_object_->GetFont();
+ }
+ void SetFont(std::shared_ptr<platform::graphics::IFont> font) override {
+ text_render_object_->SetFont(std::move(font));
+ }
+
+ std::shared_ptr<platform::graphics::IBrush> GetContentBrush() const override {
+ return GetTextBrush();
+ }
+
+ void SetContentBrush(
+ std::shared_ptr<platform::graphics::IBrush> brush) override {
+ SetTextBrush(std::move(brush));
+ }
+
private:
std::unique_ptr<render::TextRenderObject> text_render_object_;