diff options
author | Yuqian Yang <crupest@outlook.com> | 2018-09-29 03:27:37 +0000 |
---|---|---|
committer | Yuqian Yang <crupest@outlook.com> | 2018-09-29 03:27:37 +0000 |
commit | 81e171fde553d02b572653a5e763cb74ce9d331a (patch) | |
tree | 50c67f028f18486dc4a7656c82eff31cac86ec71 /src/ui/layout_base.h | |
parent | b0b5a481c9b0460f275887b15e8edecc34e99186 (diff) | |
parent | 177765d0d9d74525a9db9e756f614636828ea980 (diff) | |
download | cru-81e171fde553d02b572653a5e763cb74ce9d331a.tar.gz cru-81e171fde553d02b572653a5e763cb74ce9d331a.tar.bz2 cru-81e171fde553d02b572653a5e763cb74ce9d331a.zip |
Merge branch '8-fix-relayout' into 'master'
Resolve "Fix Relayout."
Closes #8
See merge request crupest/CruUI!10
Diffstat (limited to 'src/ui/layout_base.h')
-rw-r--r-- | src/ui/layout_base.h | 12 |
1 files changed, 12 insertions, 0 deletions
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<Control*> cache_invalid_controls_; + std::unordered_set<Window*> layout_invalid_windows_; }; } } |