From 37d9a034013b4245a50c0d748dc83d2c3d136210 Mon Sep 17 00:00:00 2001 From: Yuqian Yang Date: Mon, 8 Sep 2025 23:08:10 +0800 Subject: Fix windows dynamic lib build. --- include/cru/ui/controls/TextBlock.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'include/cru/ui/controls') diff --git a/include/cru/ui/controls/TextBlock.h b/include/cru/ui/controls/TextBlock.h index ad44ad2d..52e227eb 100644 --- a/include/cru/ui/controls/TextBlock.h +++ b/include/cru/ui/controls/TextBlock.h @@ -16,6 +16,14 @@ class CRU_UI_API TextBlock : public NoChildControl, public: static constexpr StringView kControlType = u"TextBlock"; + static std::unique_ptr Create(String text, + bool selectable = false) { + auto c = std::make_unique(); + c->SetText(std::move(text)); + c->SetSelectable(selectable); + return std::move(c); + } + public: TextBlock(); TextBlock(const TextBlock& other) = delete; @@ -24,11 +32,6 @@ class CRU_UI_API TextBlock : public NoChildControl, TextBlock& operator=(TextBlock&& other) = delete; ~TextBlock() override; - TextBlock(String text, bool selectable = false) : TextBlock() { - SetText(std::move(text)); - SetSelectable(selectable); - } - String GetControlType() const final { return kControlType.ToString(); } render::RenderObject* GetRenderObject() const override; -- cgit v1.2.3