summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2010-05-17 20:49:41 +0000
committeralberth <alberth@openttd.org>2010-05-17 20:49:41 +0000
commit255a3331bf6f58ea2ef2cb4d97b49f2a386d3f1b (patch)
treeb72a32e986b3d0af0b6f295cb9d22b83dfdabb06 /src
parente1b8a0a74075e81c165882368d688d0a1a05336d (diff)
downloadopenttd-255a3331bf6f58ea2ef2cb4d97b49f2a386d3f1b.tar.xz
(svn r19848) -Fix (r19837): Center the texts of the inactive newgrfs.
Diffstat (limited to 'src')
-rw-r--r--src/newgrf_gui.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/newgrf_gui.cpp b/src/newgrf_gui.cpp
index 1811f5365..bd16e378d 100644
--- a/src/newgrf_gui.cpp
+++ b/src/newgrf_gui.cpp
@@ -372,6 +372,7 @@ struct NewGRFWindow : public QueryStringBaseWindow {
GfxFillRect(r.left + 1, r.top + 1, r.right - 1, r.bottom - 1, 0xD7);
uint step_height = this->GetWidget<NWidgetBase>(SNGRFS_AVAIL_LIST)->resize_y;
+ int offset_y = (step_height - FONT_HEIGHT_NORMAL) / 2;
uint y = r.top + WD_FRAMERECT_TOP;
uint min_index = this->vscroll2.GetPosition();
uint max_index = min(min_index + this->vscroll2.GetCapacity(), this->avails.Length());
@@ -383,7 +384,7 @@ struct NewGRFWindow : public QueryStringBaseWindow {
const char *text = c->GetName();
if (h) GfxFillRect(r.left + 1, y, r.right - 1, y + step_height - 1, 156);
- DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y, text, h ? TC_WHITE : TC_SILVER);
+ DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, y + offset_y, text, h ? TC_WHITE : TC_SILVER);
y += step_height;
}
break;