summaryrefslogtreecommitdiff
path: root/src/gui/window.cpp
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-12-07 15:23:34 +0100
committerIra Rice <irarice@gmail.com>2008-12-07 20:04:18 -0700
commitca96882fe9319f687fce46c18f6edc671e4efc8a (patch)
tree7ae83e3613fdea072feac03296c39123b24826f7 /src/gui/window.cpp
parent65e00cfe8c9ec876e3fadadac99a6cad0697283d (diff)
downloadmana-client-ca96882fe9319f687fce46c18f6edc671e4efc8a.tar.gz
mana-client-ca96882fe9319f687fce46c18f6edc671e4efc8a.tar.bz2
mana-client-ca96882fe9319f687fce46c18f6edc671e4efc8a.tar.xz
mana-client-ca96882fe9319f687fce46c18f6edc671e4efc8a.zip
Fixed inconsistency in default window sizes
The default window sizes were all too small, since they were specified in content size. On pressing "Reset Windows", the sizes would be interpreted as such and apply alright. The inconsistency is now removed, and the default window sizes are always the size of the whole widget now, not just the contents. Signed-off-by: Bjørn Lindeijer <bjorn@lindeijer.nl>
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 30456a81..cdace3ae 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -233,7 +233,7 @@ void Window::setMaxHeight(unsigned int height)
void Window::setResizable(bool r)
{
- if ((bool)mGrip == r) return;
+ if ((bool) mGrip == r) return;
if (r)
{
@@ -251,9 +251,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);
}
@@ -458,13 +461,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());
@@ -477,13 +477,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);
}
}
@@ -499,7 +496,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)