summaryrefslogtreecommitdiff
path: root/src/news_gui.cpp
diff options
context:
space:
mode:
authorpeter1138 <peter1138@openttd.org>2017-03-31 23:09:50 +0000
committerpeter1138 <peter1138@openttd.org>2017-03-31 23:09:50 +0000
commitd51defb0b90ee2fb9741e4a61cd3d463ba516fa5 (patch)
tree0c8db5b6ca891a10d8181fcdc8c13751fb998e80 /src/news_gui.cpp
parent86430757bfadc8bc5481fb41fa6e1898740badbd (diff)
downloadopenttd-d51defb0b90ee2fb9741e4a61cd3d463ba516fa5.tar.xz
(svn r27838) -Fix: Small news window's fake caption (r19943) was not sized to fit its text.
Diffstat (limited to 'src/news_gui.cpp')
-rw-r--r--src/news_gui.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/news_gui.cpp b/src/news_gui.cpp
index 3800af8b5..6338b760b 100644
--- a/src/news_gui.cpp
+++ b/src/news_gui.cpp
@@ -313,6 +313,15 @@ struct NewsWindow : Window {
{
StringID str = STR_NULL;
switch (widget) {
+ case WID_N_CAPTION: {
+ /* Caption is not a real caption (so that the window cannot be moved)
+ * thus it doesn't get the default sizing of a caption. */
+ Dimension d2 = GetStringBoundingBox(STR_NEWS_MESSAGE_CAPTION);
+ d2.height += WD_CAPTIONTEXT_TOP + WD_CAPTIONTEXT_BOTTOM;
+ *size = maxdim(*size, d2);
+ return;
+ }
+
case WID_N_MGR_FACE:
*size = maxdim(*size, GetSpriteSize(SPR_GRADIENT));
break;