diff options
author | crupest <crupest@outlook.com> | 2019-03-24 19:44:31 +0800 |
---|---|---|
committer | crupest <crupest@outlook.com> | 2019-03-24 19:44:31 +0800 |
commit | b76e435faca204f830644047077ab08930dc8f9c (patch) | |
tree | 8bca146bc7443a704d3cb4b71b36e632cb505c25 /src/ui/controls/button.hpp | |
parent | 79d1d76509dbf6cf9c79f8eb55968535982975aa (diff) | |
download | cru-b76e435faca204f830644047077ab08930dc8f9c.tar.gz cru-b76e435faca204f830644047077ab08930dc8f9c.tar.bz2 cru-b76e435faca204f830644047077ab08930dc8f9c.zip |
...
Diffstat (limited to 'src/ui/controls/button.hpp')
-rw-r--r-- | src/ui/controls/button.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
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 <memory> + #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::BorderRenderObject> render_object_{}; }; } // namespace cru::ui::controls |