From 38221428a5ea4bc71f03508dafdc6ad65ebfbea1 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 26 Feb 2022 21:13:52 +0800 Subject: ... --- src/ui/controls/TextBlock.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/ui/controls/TextBlock.cpp') diff --git a/src/ui/controls/TextBlock.cpp b/src/ui/controls/TextBlock.cpp index f3d2405b..79c66865 100644 --- a/src/ui/controls/TextBlock.cpp +++ b/src/ui/controls/TextBlock.cpp @@ -1,5 +1,8 @@ #include "cru/ui/controls/TextBlock.h" +#include "../Helper.h" +#include "cru/platform/graphics/Factory.h" +#include "cru/platform/gui/UiApplication.h" #include "cru/ui/ThemeManager.h" #include "cru/ui/render/CanvasRenderObject.h" #include "cru/ui/render/StackLayoutRenderObject.h" @@ -39,6 +42,11 @@ bool TextBlock::IsSelectable() const { return service_->IsEnabled(); } void TextBlock::SetSelectable(bool value) { service_->SetEnabled(value); } +void TextBlock::SetTextColor(const Color& color) { + text_render_object_->SetBrush( + GetUiApplication()->GetGraphicsFactory()->CreateSolidColorBrush(color)); +} + gsl::not_null TextBlock::GetTextRenderObject() { return text_render_object_.get(); } -- cgit v1.2.3