diff options
Diffstat (limited to 'src/ui/controls/TextBlock.cpp')
-rw-r--r-- | src/ui/controls/TextBlock.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
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<render::TextRenderObject*> TextBlock::GetTextRenderObject() { return text_render_object_.get(); } |