summaryrefslogtreecommitdiff
path: root/src/gui/window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/window.cpp')
-rw-r--r--src/gui/window.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 48fe3bfb..bf5f03db 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -229,6 +229,13 @@ void Window::setSize(int width, int height)
height - mGrip->getHeight() - area.y);
}
+ if (mLayout)
+ {
+ mLayout->setWidth(width - 2 * getPadding());
+ mLayout->setHeight(height - getPadding() - getTitleBarHeight());
+ mLayout->reflow();
+ }
+
fireWindowEvent(WindowEvent(this, WindowEvent::WINDOW_RESIZED));
}
@@ -615,5 +622,9 @@ void Window::reflowLayout()
{
if (!mLayout) return;
mLayout->reflow();
+ Layout *tmp = mLayout;
+ // Hide it so that the incoming resize does not reflow the layout again.
+ mLayout = NULL;
resizeToContent();
+ mLayout = tmp;
}