aboutsummaryrefslogtreecommitdiff
path: root/include/cru/ui/controls/Window.h
diff options
context:
space:
mode:
authorYuqian Yang <crupest@crupest.life>2025-11-19 02:59:30 +0800
committerYuqian Yang <crupest@crupest.life>2025-11-19 02:59:30 +0800
commit2eb34dfc3dd3ca718da6ebf049886b4ae140b332 (patch)
treec43dbca6e6898fd474ca9b976b4bf21b3419e512 /include/cru/ui/controls/Window.h
parentdf2dadbd0f0ace6e02281c84218537ec2ce5c47f (diff)
downloadcru-2eb34dfc3dd3ca718da6ebf049886b4ae140b332.tar.gz
cru-2eb34dfc3dd3ca718da6ebf049886b4ae140b332.tar.bz2
cru-2eb34dfc3dd3ca718da6ebf049886b4ae140b332.zip
Remove all children when control destroyed.
Diffstat (limited to 'include/cru/ui/controls/Window.h')
-rw-r--r--include/cru/ui/controls/Window.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/cru/ui/controls/Window.h b/include/cru/ui/controls/Window.h
index a2ae01f9..3d3ff0b0 100644
--- a/include/cru/ui/controls/Window.h
+++ b/include/cru/ui/controls/Window.h
@@ -1,5 +1,6 @@
#pragma once
#include "../render/StackLayoutRenderObject.h"
+#include "ControlHost.h"
#include "LayoutControl.h"
#include <cru/base/Base.h>
@@ -9,6 +10,8 @@
#include <cru/platform/gui/UiApplication.h>
#include <cru/platform/gui/Window.h>
+#include <memory>
+
namespace cru::ui::controls {
class CRU_UI_API Window
: public LayoutControl<render::StackLayoutRenderObject> {
@@ -31,7 +34,7 @@ class CRU_UI_API Window
void SetGainFocusOnCreateAndDestroyWhenLoseFocus(bool value);
private:
- std::shared_ptr<ControlHost> control_host_;
+ std::unique_ptr<ControlHost> control_host_;
Control* attached_control_;