diff options
author | rubidium <rubidium@openttd.org> | 2009-11-02 10:15:48 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2009-11-02 10:15:48 +0000 |
commit | 4a970202a9101be3fdd22ff060140e46133490dc (patch) | |
tree | b25b612ff18784db968ad7edcdd4d689883ee6ea /src/news_gui.cpp | |
parent | 148d9b8e387cf7298421747917d17c00acc7bb99 (diff) | |
download | openttd-4a970202a9101be3fdd22ff060140e46133490dc.tar.xz |
(svn r17947) -Codechange: make the statusbar, chat input and news window know of eachothers size so they don't get overlapped and don't get invisible (bottoms) of windows when a larger font is used
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r-- | src/news_gui.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp index ba27eef27..5686102f1 100644 --- a/src/news_gui.cpp +++ b/src/news_gui.cpp @@ -280,6 +280,7 @@ assert_compile(lengthof(_news_type_data) == NT_END); /** Window class displaying a news item. */ struct NewsWindow : Window { uint16 chat_height; ///< Height of the chat window. + uint16 status_height; ///< Height of the status bar window NewsItem *ni; ///< News item to display. static uint duration; ///< Remaining time for showing current news message (may only be accessed while a news item is displayed). @@ -288,6 +289,7 @@ struct NewsWindow : Window { NewsWindow::duration = 555; const Window *w = FindWindowById(WC_SEND_NETWORK_MSG, 0); this->chat_height = (w != NULL) ? w->height : 0; + this->status_height = FindWindowById(WC_STATUS_BAR, 0)->height; this->flags4 |= WF_DISABLE_VP_SCROLL; @@ -490,7 +492,7 @@ struct NewsWindow : Window { virtual void OnTick() { /* Scroll up newsmessages from the bottom in steps of 4 pixels */ - int y = max(this->top - 4, _screen.height - this->height - 12 - this->chat_height); + int y = max(this->top - 4, _screen.height - this->height - this->status_height - this->chat_height); if (y == this->top) return; if (this->viewport != NULL) this->viewport->top += y - this->top; |