aboutsummaryrefslogtreecommitdiff
path: root/src/ui/control.cpp
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-04-12 20:30:49 +0800
committercrupest <crupest@outlook.com>2020-04-12 20:30:49 +0800
commitdb663ebb463dc00416038d068e538ab410558503 (patch)
tree5c20cac738e2a7111ba61754479a774c2e9e0c0a /src/ui/control.cpp
parent23ef59b6aa14874e3b68c8716c137eb65583cd63 (diff)
downloadcru-db663ebb463dc00416038d068e538ab410558503.tar.gz
cru-db663ebb463dc00416038d068e538ab410558503.tar.bz2
cru-db663ebb463dc00416038d068e538ab410558503.zip
...
Diffstat (limited to 'src/ui/control.cpp')
-rw-r--r--src/ui/control.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ui/control.cpp b/src/ui/control.cpp
index 7691dac2..5417f4ce 100644
--- a/src/ui/control.cpp
+++ b/src/ui/control.cpp
@@ -33,12 +33,12 @@ void Control::_SetParent(Control* parent) {
}
void Control::_SetDescendantUiHost(UiHost* host) {
+ if (host == nullptr && ui_host_ == nullptr) return;
+
// You can only attach or detach window.
Expects((host != nullptr && ui_host_ == nullptr) ||
(host == nullptr && ui_host_ != nullptr));
- if (host == nullptr && ui_host_ == nullptr) return;
-
if (host == nullptr) {
const auto old = ui_host_;
TraverseDescendants([old](Control* control) {