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.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 13c8f4ce..4689c86a 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -1,9 +1,8 @@
/*
- * Aethyra
+ * The Mana World
* Copyright (C) 2004 The Mana World Development Team
*
- * This file is part of Aethyra based on original code
- * from The Mana World.
+ * This file is part of The Mana World.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -77,7 +76,7 @@ Window::Window(const std::string& caption, bool modal, Window *parent, const std
if (instances == 0)
{
skinLoader = new SkinLoader();
- windowConfigListener = new WindowConfigListener();
+ windowConfigListener = new WindowConfigListener;
// Send GUI alpha changed for initialization
windowConfigListener->optionChanged("guialpha");
config.addListener("guialpha", windowConfigListener);
@@ -283,7 +282,7 @@ void Window::setResizable(bool r)
if (r)
{
- mGrip = new ResizeGrip();
+ mGrip = new ResizeGrip;
mGrip->setX(getWidth() - mGrip->getWidth() - getChildrenArea().x);
mGrip->setY(getHeight() - mGrip->getHeight() - getChildrenArea().y);
add(mGrip);
@@ -577,6 +576,14 @@ void Window::setDefaultSize(int defaultX, int defaultY,
mDefaultHeight = defaultHeight;
}
+void Window::setDefaultSize()
+{
+ mDefaultX = getX();
+ mDefaultY = getY();
+ mDefaultWidth = getWidth();
+ mDefaultHeight = getHeight();
+}
+
void Window::setDefaultSize(int defaultWidth, int defaultHeight,
ImageRect::ImagePosition position,
int offsetX, int offsetY)
@@ -709,3 +716,7 @@ void Window::reflowLayout(int w, int h)
setContentSize(w, h);
}
+void Window::center()
+{
+ setLocationRelativeTo(getParent());
+}