From c1dbad5fdf0560983e6c832eddded6f610eae94e Mon Sep 17 00:00:00 2001 From: crupest Date: Thu, 10 Feb 2022 19:49:06 +0800 Subject: ... --- include/cru/ui/controls/TextBlock.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'include/cru/ui/controls/TextBlock.h') diff --git a/include/cru/ui/controls/TextBlock.h b/include/cru/ui/controls/TextBlock.h index feb5cfa3..dc47d00a 100644 --- a/include/cru/ui/controls/TextBlock.h +++ b/include/cru/ui/controls/TextBlock.h @@ -10,19 +10,19 @@ class CRU_UI_API TextBlock : public NoChildControl, public: static constexpr StringView kControlType = u"TextBlock"; - static TextBlock* Create(); - static TextBlock* Create(String text, bool selectable = false); - - protected: - TextBlock(); - public: + TextBlock(); TextBlock(const TextBlock& other) = delete; TextBlock(TextBlock&& other) = delete; TextBlock& operator=(const TextBlock& other) = delete; 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