From 177765d0d9d74525a9db9e756f614636828ea980 Mon Sep 17 00:00:00 2001 From: crupest Date: Sat, 29 Sep 2018 11:13:31 +0800 Subject: Fix relayout system. --- src/ui/layout_base.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/ui/layout_base.h') diff --git a/src/ui/layout_base.h b/src/ui/layout_base.h index 163b99b2..126437cd 100644 --- a/src/ui/layout_base.h +++ b/src/ui/layout_base.h @@ -11,6 +11,7 @@ namespace cru namespace ui { class Control; + class Window; enum class Alignment { @@ -114,6 +115,9 @@ namespace cru LayoutManager& operator=(LayoutManager&& other) = delete; ~LayoutManager() override = default; + + //*************** region: position cache *************** + //Mark position cache of the control and its descendants invalid, //(which is saved as an auto-managed list internal) //and send a message to refresh them. @@ -126,11 +130,19 @@ namespace cru //Refresh position cache of the control and its descendants immediately. static void RefreshControlPositionCache(Control* control); + + //*************** region: layout *************** + + void InvalidateWindowLayout(Window* window); + + void RefreshInvalidWindowLayout(); + private: static void RefreshControlPositionCacheInternal(Control* control, const Point& parent_lefttop_absolute); private: std::unordered_set cache_invalid_controls_; + std::unordered_set layout_invalid_windows_; }; } } -- cgit v1.2.3