From a60910cb3db6f47fd8f3b7f31648a9d0514d4f2c Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 20 Nov 2021 22:43:30 +0800 Subject: ... --- src/ui/components/Menu.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/ui/components/Menu.cpp') diff --git a/src/ui/components/Menu.cpp b/src/ui/components/Menu.cpp index af54c46c..964eead9 100644 --- a/src/ui/components/Menu.cpp +++ b/src/ui/components/Menu.cpp @@ -1,4 +1,5 @@ #include "cru/ui/components/Menu.hpp" +#include "cru/platform/gui/Window.hpp" #include "cru/ui/UiManager.hpp" #include "cru/ui/controls/Button.hpp" #include "cru/ui/controls/Control.hpp" @@ -82,11 +83,11 @@ PopupMenu::~PopupMenu() { controls::Control* PopupMenu::GetRootControl() { return popup_; } void PopupMenu::SetPosition(const Point& position) { - popup_->SetRect(Rect{position, {}}); + popup_->GetWindowHost()->GetNativeWindow()->SetClientRect(Rect{position, {}}); } void PopupMenu::Show() { popup_->GetWindowHost()->RelayoutWithSize(Size::Infinate(), true); - popup_->Show(); + popup_->GetWindowHost()->GetNativeWindow()->SetVisible(true); } } // namespace cru::ui::components -- cgit v1.2.3