summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-10-21 19:05:56 +0000
committerGuillaume Melquiond <guillaume.melquiond@gmail.com>2007-10-21 19:05:56 +0000
commit0b478a22bfd5134dd6f43b5e4ade3ebacd8777f1 (patch)
tree71d99180551c0f3f6246757ee41f23367eb37ef9 /src
parent18c675031f718523586e72f5e1450bb33d457841 (diff)
downloadmana-client-0b478a22bfd5134dd6f43b5e4ade3ebacd8777f1.tar.gz
mana-client-0b478a22bfd5134dd6f43b5e4ade3ebacd8777f1.tar.bz2
mana-client-0b478a22bfd5134dd6f43b5e4ade3ebacd8777f1.tar.xz
mana-client-0b478a22bfd5134dd6f43b5e4ade3ebacd8777f1.zip
Changed to use default values when restoring missing settings.
Diffstat (limited to 'src')
-rw-r--r--src/gui/window.cpp15
-rw-r--r--src/gui/window.h7
2 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index f8d4a503..1509ac92 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -525,13 +525,17 @@ void Window::loadWindowState(std::string const &name)
{
mConfigName = name;
- setPosition((int) config.getValue(name + "WinX", getX()),
- (int) config.getValue(name + "WinY", getY()));
+ setPosition((int) config.getValue(name + "WinX", mDefaultX),
+ (int) config.getValue(name + "WinY", mDefaultY));
if (mGrip)
{
- setSize((int) config.getValue(name + "WinWidth", getWidth()),
- (int) config.getValue(name + "WinHeight", getHeight()));
+ setSize((int) config.getValue(name + "WinWidth", mDefaultWidth),
+ (int) config.getValue(name + "WinHeight", mDefaultHeight));
+ }
+ else
+ {
+ setSize(mDefaultWidth, mDefaultHeight);
}
}
@@ -542,9 +546,6 @@ void Window::setDefaultSize(int defaultX, int defaultY,
mDefaultY = defaultY;
mDefaultWidth = defaultWidth;
mDefaultHeight = defaultHeight;
-
- setPosition(mDefaultX, mDefaultY);
- setContentSize(mDefaultWidth, mDefaultHeight);
}
void Window::resetToDefaultSize()
diff --git a/src/gui/window.h b/src/gui/window.h
index 651a8a4e..a09a9bbc 100644
--- a/src/gui/window.h
+++ b/src/gui/window.h
@@ -240,10 +240,9 @@ class Window : public gcn::Window
void mouseExited(gcn::MouseEvent &event);
/**
- * Read the x, y, and width and height for resizables in the config
- * based on the given string.
- * That function let the values set with set{X, Y, Height, width}()
- * if no config value is found.
+ * Reads the position (and the size for resizable windows) in the
+ * configuration based on the given string.
+ * Uses the default values when config values are missing.
* Don't forget to set these default values and resizable before
* calling this function.
*/