aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/TextBlock.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2022-02-26 21:13:52 +0800
committercrupest <crupest@outlook.com>2022-02-26 21:13:52 +0800
commit38221428a5ea4bc71f03508dafdc6ad65ebfbea1 (patch)
tree3248edb39faf98aa19647f30477bcc6cf734ebb3 /src/ui/controls/TextBlock.cpp
parent8da596f7b5fdbcf11fbda4aa66efc87a219f58ae (diff)
downloadcru-38221428a5ea4bc71f03508dafdc6ad65ebfbea1.tar.gz
cru-38221428a5ea4bc71f03508dafdc6ad65ebfbea1.tar.bz2
cru-38221428a5ea4bc71f03508dafdc6ad65ebfbea1.zip
...
Diffstat (limited to 'src/ui/controls/TextBlock.cpp')
-rw-r--r--src/ui/controls/TextBlock.cpp8
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();
}