diff options
| author | Yuqian Yang <crupest@crupest.life> | 2025-11-19 02:59:30 +0800 |
|---|---|---|
| committer | Yuqian Yang <crupest@crupest.life> | 2025-11-19 02:59:30 +0800 |
| commit | 2eb34dfc3dd3ca718da6ebf049886b4ae140b332 (patch) | |
| tree | c43dbca6e6898fd474ca9b976b4bf21b3419e512 /include/cru/ui/components/Menu.h | |
| parent | df2dadbd0f0ace6e02281c84218537ec2ce5c47f (diff) | |
| download | cru-2eb34dfc3dd3ca718da6ebf049886b4ae140b332.tar.gz cru-2eb34dfc3dd3ca718da6ebf049886b4ae140b332.tar.bz2 cru-2eb34dfc3dd3ca718da6ebf049886b4ae140b332.zip | |
Remove all children when control destroyed.
Diffstat (limited to 'include/cru/ui/components/Menu.h')
| -rw-r--r-- | include/cru/ui/components/Menu.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/cru/ui/components/Menu.h b/include/cru/ui/components/Menu.h index 92731f2e..a8a90ed7 100644 --- a/include/cru/ui/components/Menu.h +++ b/include/cru/ui/components/Menu.h @@ -70,7 +70,7 @@ class CRU_UI_API PopupMenu : public Component { public: controls::Control* GetRootControl() override; - controls::Window* GetPopup() { return popup_; } + controls::Window* GetPopup() { return popup_.get(); } Menu* GetMenu() { return &menu_; } // position relative to screen left top. @@ -86,7 +86,7 @@ class CRU_UI_API PopupMenu : public Component { private: controls::Control* attached_control_; - controls::Window* popup_; + std::unique_ptr<controls::Window> popup_; Menu menu_; }; } // namespace cru::ui::components |
