summaryrefslogtreecommitdiff
path: root/src/window_gui.h
diff options
context:
space:
mode:
authorfrosch <frosch@openttd.org>2013-05-26 19:30:31 +0000
committerfrosch <frosch@openttd.org>2013-05-26 19:30:31 +0000
commit05c472f08afdfc6d56fa45f941c17657358d0733 (patch)
tree4ea9f6b3f66eb9d9e495c48c55a642b4934ec260 /src/window_gui.h
parent4e4e635916d7852c0da9a53edd2d510080922ed5 (diff)
downloadopenttd-05c472f08afdfc6d56fa45f941c17657358d0733.tar.xz
(svn r25295) -Feature: Allow saving window sizes as default sizes.
Diffstat (limited to 'src/window_gui.h')
-rw-r--r--src/window_gui.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/window_gui.h b/src/window_gui.h
index 4055f7caf..6288aadc1 100644
--- a/src/window_gui.h
+++ b/src/window_gui.h
@@ -189,6 +189,11 @@ struct WindowDesc : ZeroedMemoryAllocator {
int16 nwid_length; ///< Length of the #nwid_parts array.
bool pref_sticky; ///< Preferred stickyness.
+ int16 pref_width; ///< User-preferred width of the window. Zero if unset.
+ int16 pref_height; ///< User-preferred height of the window. Zero if unset.
+
+ int16 GetDefaultWidth() const { return this->pref_width != 0 ? this->pref_width : this->default_width; }
+ int16 GetDefaultHeight() const { return this->pref_height != 0 ? this->pref_height : this->default_height; }
static void LoadFromConfig();
static void SaveToConfig();