From b76e435faca204f830644047077ab08930dc8f9c Mon Sep 17 00:00:00 2001 From: crupest Date: Sun, 24 Mar 2019 19:44:31 +0800 Subject: ... --- src/ui/controls/button.hpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/ui/controls/button.hpp') diff --git a/src/ui/controls/button.hpp b/src/ui/controls/button.hpp index 27e7fc7b..3f313dfc 100644 --- a/src/ui/controls/button.hpp +++ b/src/ui/controls/button.hpp @@ -1,6 +1,8 @@ #pragma once #include "pre.hpp" +#include + #include "ui/content_control.hpp" namespace cru::ui::render { @@ -12,7 +14,7 @@ class Button : public ContentControl { public: static constexpr auto control_type = L"Button"; - static Button* Create(); + static Button* Create() { return new Button(); } protected: Button(); @@ -22,7 +24,9 @@ class Button : public ContentControl { Button(Button&& other) = delete; Button& operator=(const Button& other) = delete; Button& operator=(Button&& other) = delete; - ~Button(); + ~Button() override = default; + + StringView GetControlType() const override final { return control_type; } render::RenderObject* GetRenderObject() const override; @@ -30,6 +34,6 @@ class Button : public ContentControl { void OnChildChanged(Control* old_child, Control* new_child) override; private: - render::BorderRenderObject* render_object_; + std::shared_ptr render_object_{}; }; } // namespace cru::ui::controls -- cgit v1.2.3