diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-12-07 15:23:34 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2008-12-07 15:25:28 +0100 |
commit | 72f5288682f46af1f7c04c002172178c880e060b (patch) | |
tree | 444ef1af05fc74dd072ad2be51c6ff7ab7ce976e /src/gui/window.cpp | |
parent | be25d46954a98b2590b522de5f8aa470ba4f9e81 (diff) | |
download | mana-72f5288682f46af1f7c04c002172178c880e060b.tar.gz mana-72f5288682f46af1f7c04c002172178c880e060b.tar.bz2 mana-72f5288682f46af1f7c04c002172178c880e060b.tar.xz mana-72f5288682f46af1f7c04c002172178c880e060b.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.cpp | 19 |
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) |