From 93265251d56c91b05f160423077ce95339786f87 Mon Sep 17 00:00:00 2001 From: crupest Date: Fri, 30 Oct 2020 13:14:34 +0800 Subject: ... --- include/cru/ui/host/WindowHost.hpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'include/cru/ui/host/WindowHost.hpp') diff --git a/include/cru/ui/host/WindowHost.hpp b/include/cru/ui/host/WindowHost.hpp index 77ed937f..81eabb52 100644 --- a/include/cru/ui/host/WindowHost.hpp +++ b/include/cru/ui/host/WindowHost.hpp @@ -7,8 +7,11 @@ #include "../render/Base.hpp" #include +#include namespace cru::ui::host { +class LayoutPaintCycler; + struct AfterLayoutEventArgs {}; // The bridge between control tree and native window. @@ -43,6 +46,8 @@ class WindowHost : public Object { void Relayout(); void Relayout(const Size& available_size); + void Repaint(); + // Is layout is invalid, wait for relayout and then run the action. Otherwist // run it right now. void RunAfterLayoutStable(std::function action); @@ -125,7 +130,8 @@ class WindowHost : public Object { platform::gui::INativeWindow* native_window_ = nullptr; - bool need_layout_ = false; + std::unique_ptr layout_paint_cycler_; + Event after_layout_event_; std::vector > after_layout_stable_action_; -- cgit v1.2.3