aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/Popup.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-11-09 20:06:04 +0800
committercrupest <crupest@outlook.com>2020-11-09 20:06:04 +0800
commit68fc33443981fcd499dfe263c228787e213ae943 (patch)
tree6a11d424a958d9c566e4c0b85b32212bfad9a1dc /src/ui/controls/Popup.cpp
parentddc6d6478f849ef10b832bc8b1d8ab7fe9454601 (diff)
downloadcru-68fc33443981fcd499dfe263c228787e213ae943.tar.gz
cru-68fc33443981fcd499dfe263c228787e213ae943.tar.bz2
cru-68fc33443981fcd499dfe263c228787e213ae943.zip
...
Diffstat (limited to 'src/ui/controls/Popup.cpp')
-rw-r--r--src/ui/controls/Popup.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/ui/controls/Popup.cpp b/src/ui/controls/Popup.cpp
index 982aee38..bc217bf5 100644
--- a/src/ui/controls/Popup.cpp
+++ b/src/ui/controls/Popup.cpp
@@ -1,19 +1,22 @@
#include "cru/ui/controls/Popup.hpp"
#include "cru/platform/gui/UiApplication.hpp"
+#include "cru/ui/controls/RootControl.hpp"
#include "cru/ui/host/WindowHost.hpp"
#include "cru/ui/render/StackLayoutRenderObject.hpp"
#include <memory>
namespace cru::ui::controls {
-Popup::Popup(Control* attached_control) : attached_control_(attached_control) {
- render_object_ = std::make_unique<render::StackLayoutRenderObject>();
- render_object_->SetAttachedControl(this);
- SetContainerRenderObject(render_object_.get());
+Popup::Popup(Control* attached_control) : RootControl(attached_control) {}
- window_host_ = std::make_unique<host::WindowHost>(this);
+Popup::~Popup() = default;
+
+gsl::not_null<platform::gui::INativeWindow*> Popup::CreateNativeWindow(
+ gsl::not_null<host::WindowHost*> host,
+ platform::gui::INativeWindow* parent) {
+ return host->CreateNativeWindow(
+ {parent, platform::gui::CreateWindowFlags::NoCaptionAndBorder});
}
-Popup::~Popup() = default;
} // namespace cru::ui::controls