From 4e0a5338f15a247c33df863c4c619ffdb0a98aae Mon Sep 17 00:00:00 2001 From: crupest Date: Wed, 28 Oct 2020 17:51:41 +0800 Subject: ... --- include/cru/ui/UiHost.hpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include/cru') diff --git a/include/cru/ui/UiHost.hpp b/include/cru/ui/UiHost.hpp index 01791de6..2437b967 100644 --- a/include/cru/ui/UiHost.hpp +++ b/include/cru/ui/UiHost.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include "Base.hpp" #include "cru/common/Event.hpp" @@ -110,6 +111,10 @@ class UiHost : public Object, public SelfResolvable { void SetRetainAfterDestroy(bool destroy) { retain_after_destroy_ = destroy; } + // Is layout is invalid, wait for relayout and then run the action. Otherwist + // run it right now. + void RunAfterLayoutStable(std::function action); + private: //*************** region: native messages *************** void OnNativeDestroy(platform::native::INativeWindow* window, std::nullptr_t); @@ -148,6 +153,7 @@ class UiHost : public Object, public SelfResolvable { bool need_layout_ = false; Event after_layout_event_; + std::vector > after_layout_stable_action_; std::shared_ptr native_window_resolver_; -- cgit v1.2.3