diff options
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 |