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.cpp19
1 files changed, 8 insertions, 11 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 58544f7e..602441fb 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -240,7 +240,7 @@ void Window::setMaxHeight(unsigned int height)
void Window::setResizable(bool r)
{
- if ((bool)mGrip == r) return;
+ if ((bool) mGrip == r) return;
if (r)
{
@@ -258,9 +258,12 @@ void Window::setResizable(bool r)
void Window::widgetResized(const gcn::Event &event)
{
+ const gcn::Rectangle area = getChildrenArea();
+
+ mChrome->setSize(area.width, area.height);
+
if (mGrip)
{
- gcn::Rectangle const &area = getChildrenArea();
mGrip->setPosition(getWidth() - mGrip->getWidth() - area.x,
getHeight() - mGrip->getHeight() - area.y);
}
@@ -465,13 +468,10 @@ void Window::mouseDragged(gcn::MouseEvent &event)
// Set the new window and content dimensions
setDimension(newDim);
- const gcn::Rectangle area = getChildrenArea();
- mChrome->setSize(area.width, area.height);
}
}
-void
-Window::loadWindowState()
+void Window::loadWindowState()
{
const std::string &name = mWindowName;
assert(!name.empty());
@@ -484,13 +484,10 @@ Window::loadWindowState()
{
setSize((int) config.getValue(name + "WinWidth", mDefaultWidth),
(int) config.getValue(name + "WinHeight", mDefaultHeight));
-
- const gcn::Rectangle area = getChildrenArea();
- mChrome->setSize(area.width, area.height);
}
else
{
- setContentSize(mDefaultWidth, mDefaultHeight);
+ setSize(mDefaultWidth, mDefaultHeight);
}
}
@@ -506,7 +503,7 @@ void Window::setDefaultSize(int defaultX, int defaultY,
void Window::resetToDefaultSize()
{
setPosition(mDefaultX, mDefaultY);
- setContentSize(mDefaultWidth, mDefaultHeight);
+ setSize(mDefaultWidth, mDefaultHeight);
}
int Window::getResizeHandles(gcn::MouseEvent &event)