summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-22 19:19:11 +0000
committerrubidium <rubidium@openttd.org>2009-11-22 19:19:11 +0000
commitcf354803d675eb4370659d1ed237b642a3f29193 (patch)
tree872284e69438c5cbc6cdf45a7292ba9eb991abb4
parent3d6edbdf4695317edddb86344a9c9577546313dd (diff)
downloadopenttd-cf354803d675eb4370659d1ed237b642a3f29193.tar.xz
(svn r18238) -Codechange: make the autoreplace window big font aware
-rw-r--r--src/autoreplace_gui.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/src/autoreplace_gui.cpp b/src/autoreplace_gui.cpp
index 0f7540519..6dd6ae69a 100644
--- a/src/autoreplace_gui.cpp
+++ b/src/autoreplace_gui.cpp
@@ -279,6 +279,19 @@ public:
*size = maxdim(*size, d);
break;
}
+
+ case RVW_WIDGET_TRAIN_RAILTYPE_DROPDOWN: {
+ Dimension d = {0, 0};
+ for (RailType rt = RAILTYPE_BEGIN; rt != RAILTYPE_END; rt++) {
+ const RailtypeInfo *rti = GetRailTypeInfo(rt);
+ /* Skip rail type if it has no label */
+ if (rti->label == 0) continue;
+ d = maxdim(d, GetStringBoundingBox(rti->strings.replace_text));
+ }
+ d.width += padding.width;
+ d.height += padding.height;
+ *size = maxdim(*size, d);
+ } break;
}
}
@@ -317,7 +330,7 @@ public:
SetDParam(0, STR_REPLACE_NOT_REPLACING_VEHICLE_SELECTED);
}
- DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_BLACK_STRING);
+ DrawString(r.left + WD_FRAMETEXT_LEFT, r.right - WD_FRAMETEXT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_BLACK_STRING, TC_FROMSTRING, SA_CENTER);
break;
}