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, 21 insertions, 0 deletions
diff --git a/src/gui/window.cpp b/src/gui/window.cpp
index 0446e6eb..5b125bd2 100644
--- a/src/gui/window.cpp
+++ b/src/gui/window.cpp
@@ -441,3 +441,24 @@ void Window::loadWindowState()
}
}
}
+
+void Window::setDefaultSize(int defaultX, int defaultY, int defaultWidth, int defaultHeight)
+{
+ this->defaultX = defaultX;
+ this->defaultY = defaultY;
+ this->defaultWidth = defaultWidth;
+ this->defaultHeight = defaultHeight;
+
+ setPosition(defaultX, defaultY);
+ setContentSize(defaultWidth, defaultHeight);
+}
+
+void Window::resetToDefaultSize()
+{
+ setPosition(defaultX, defaultY);
+ setContentSize(defaultWidth, defaultHeight);
+ if (mContent != NULL)
+ {
+ mContent->setDimension(getContentDimension());
+ }
+}