diff options
author | terkhen <terkhen@openttd.org> | 2011-02-11 18:24:12 +0000 |
---|---|---|
committer | terkhen <terkhen@openttd.org> | 2011-02-11 18:24:12 +0000 |
commit | 8196b03074184cd75e85263a07d9eca63f5c6721 (patch) | |
tree | 08c9fc4d5ea01c205db3e0d0d072ab375e0d5a4a /src/window.cpp | |
parent | b1873526635efa1b6fb2e2ba636f0d3368a9389e (diff) | |
download | openttd-8196b03074184cd75e85263a07d9eca63f5c6721.tar.xz |
(svn r22059) -Fix (r21179): Make the send chat message window follow the position of the status bar.
Diffstat (limited to 'src/window.cpp')
-rw-r--r-- | src/window.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/window.cpp b/src/window.cpp index d6bdf4ffb..2c6f1f1e1 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -2675,6 +2675,17 @@ int PositionNewsMessage(Window *w) return PositionWindow(w, WC_NEWS_WINDOW, _settings_client.gui.statusbar_pos); } +/** + * (Re)position network chat window at the screen. + * @param w Window structure of the network chat window, may also be \c NULL. + * @return X coordinate of left edge of the repositioned network chat winodw. + */ +int PositionNetworkChatWindow(Window *w) +{ + DEBUG(misc, 5, "Repositioning network chat window..."); + return PositionWindow(w, WC_SEND_NETWORK_MSG, _settings_client.gui.statusbar_pos); +} + /** * Switches viewports following vehicles, which get autoreplaced @@ -2739,7 +2750,7 @@ void RelocateAllWindows(int neww, int newh) case WC_SEND_NETWORK_MSG: ResizeWindow(w, Clamp(neww, 320, 640) - w->width, 0); top = newh - w->height - FindWindowById(WC_STATUS_BAR, 0)->height; - left = (neww - w->width) >> 1; + left = PositionNetworkChatWindow(w); break; case WC_CONSOLE: |