diff options
author | Yuqian Yang <crupest@outlook.com> | 2018-10-04 16:52:11 +0000 |
---|---|---|
committer | Yuqian Yang <crupest@outlook.com> | 2018-10-04 16:52:11 +0000 |
commit | 7e870dd16e2f5b41fa6c6f687723aaa50c16274d (patch) | |
tree | be2b26a42dc9fde97379f98f035113e08e0bc331 /src/ui/window.cpp | |
parent | 30ecda8bb354d5982978af97aa90b5f49d9ea195 (diff) | |
parent | c5384d496e9ed429ca2baa3ca5e586ff255235eb (diff) | |
download | cru-7e870dd16e2f5b41fa6c6f687723aaa50c16274d.tar.gz cru-7e870dd16e2f5b41fa6c6f687723aaa50c16274d.tar.bz2 cru-7e870dd16e2f5b41fa6c6f687723aaa50c16274d.zip |
Merge branch '12-layout' into 'master'
Resolve "Add padding, margin, border to Control."
Closes #12
See merge request crupest/CruUI!12
Diffstat (limited to 'src/ui/window.cpp')
-rw-r--r-- | src/ui/window.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/ui/window.cpp b/src/ui/window.cpp index 39528550..9edbd398 100644 --- a/src/ui/window.cpp +++ b/src/ui/window.cpp @@ -354,8 +354,8 @@ namespace cru void Window::Relayout() { - OnMeasure(GetSize()); - OnLayout(Rect(Point::Zero(), GetSize())); + OnMeasureCore(GetSize()); + OnLayoutCore(Rect(Point::Zero(), GetSize())); } void Window::RefreshControlList() { @@ -462,7 +462,7 @@ namespace cru return ::PeekMessageW(&msg, hwnd_, message, message, PM_NOREMOVE) != 0; } - Size Window::OnMeasure(const Size& available_size) + Size Window::OnMeasureContent(const Size& available_size) { ForeachChild([available_size](Control* control) { @@ -498,9 +498,10 @@ namespace cru ValidateRect(hwnd_, nullptr); } - void Window::OnResizeInternal(int new_width, int new_height) { + void Window::OnResizeInternal(const int new_width, const int new_height) { render_target_->ResizeBuffer(new_width, new_height); - Relayout(); + if (!(new_width == 0 && new_height == 0)) + Relayout(); } void Window::OnSetFocusInternal() |