aboutsummaryrefslogtreecommitdiff
path: root/src/ui/controls/Popup.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2021-11-20 19:47:53 +0800
committercrupest <crupest@outlook.com>2021-11-20 19:47:53 +0800
commitb0b86b6b9d6798d04a320060e90bd8497a7f50f9 (patch)
treea6e3f3315a538791e1cbd4e799bc6268262feedb /src/ui/controls/Popup.cpp
parent2ad748a0fcb66398299886970cc9c40cc50b3cd0 (diff)
downloadcru-b0b86b6b9d6798d04a320060e90bd8497a7f50f9.tar.gz
cru-b0b86b6b9d6798d04a320060e90bd8497a7f50f9.tar.bz2
cru-b0b86b6b9d6798d04a320060e90bd8497a7f50f9.zip
...
Diffstat (limited to 'src/ui/controls/Popup.cpp')
-rw-r--r--src/ui/controls/Popup.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/ui/controls/Popup.cpp b/src/ui/controls/Popup.cpp
index bc217bf5..515c7b31 100644
--- a/src/ui/controls/Popup.cpp
+++ b/src/ui/controls/Popup.cpp
@@ -8,15 +8,19 @@
#include <memory>
namespace cru::ui::controls {
-Popup::Popup(Control* attached_control) : RootControl(attached_control) {}
+Popup::Popup(Control* attached_control) : RootControl(attached_control) {
+ SetGainFocusOnCreateAndDestroyWhenLoseFocus(true);
+}
Popup::~Popup() = default;
gsl::not_null<platform::gui::INativeWindow*> Popup::CreateNativeWindow(
gsl::not_null<host::WindowHost*> host,
platform::gui::INativeWindow* parent) {
- return host->CreateNativeWindow(
+ auto window = host->CreateNativeWindow(
{parent, platform::gui::CreateWindowFlags::NoCaptionAndBorder});
+
+ return window;
}
} // namespace cru::ui::controls