summaryrefslogtreecommitdiff
path: root/src/window.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-07-29 19:18:22 +0000
committerrubidium <rubidium@openttd.org>2007-07-29 19:18:22 +0000
commit17370d5ae7db88664dddf561ca7247d33d74fbcf (patch)
tree745241429ade176ce7329dc9e03909ba24becfc7 /src/window.cpp
parent5e1cd09ea41afe34e1b35b7d694f86a2589d4c68 (diff)
downloadopenttd-17370d5ae7db88664dddf561ca7247d33d74fbcf.tar.xz
(svn r10725) -Codechange: move some window related code out of gfx.cpp to windows.cpp
Diffstat (limited to 'src/window.cpp')
-rw-r--r--src/window.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/window.cpp b/src/window.cpp
index db4052de3..0427dd309 100644
--- a/src/window.cpp
+++ b/src/window.cpp
@@ -2047,6 +2047,18 @@ void RelocateAllWindows(int neww, int newh)
* in a 'backup'-desc that the window should always be centred. */
switch (w->window_class) {
case WC_MAIN_TOOLBAR:
+ if (neww - w->width != 0) {
+ ResizeWindow(w, min(neww, 640) - w->width, 0);
+
+ WindowEvent e;
+ e.event = WE_RESIZE;
+ e.we.sizing.size.x = w->width;
+ e.we.sizing.size.y = w->height;
+ e.we.sizing.diff.x = neww - w->width;
+ e.we.sizing.diff.y = 0;
+ w->wndproc(w, &e);
+ }
+
top = w->top;
left = PositionMainToolbar(w); // changes toolbar orientation
break;
@@ -2064,6 +2076,7 @@ void RelocateAllWindows(int neww, int newh)
break;
case WC_STATUS_BAR:
+ ResizeWindow(w, clamp(neww, 320, 640) - w->width, 0);
top = newh - w->height;
left = (neww - w->width) >> 1;
break;