summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2009-11-23 20:25:14 +0000
committerrubidium <rubidium@openttd.org>2009-11-23 20:25:14 +0000
commit3c109fd7f15aeb748407cf8f295b5e4521535f68 (patch)
tree6a1034cdd6f29b68011ae020180795287274c705
parentfb168e25ad3cda86b0ce26f20aa34a4efdbde435 (diff)
downloadopenttd-3c109fd7f15aeb748407cf8f295b5e4521535f68.tar.xz
(svn r18262) -Codechange: make the status bar big font aware
-rw-r--r--src/statusbar_gui.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp
index 7daf4313d..fb3b22308 100644
--- a/src/statusbar_gui.cpp
+++ b/src/statusbar_gui.cpp
@@ -111,7 +111,28 @@ struct StatusBarWindow : Window {
virtual void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize)
{
- size->height = FONT_HEIGHT_NORMAL + padding.height;
+ Dimension d;
+ switch (widget) {
+ case SBW_LEFT:
+ SetDParam(0, MAX_YEAR * DAYS_IN_YEAR);
+ d = GetStringBoundingBox(STR_WHITE_DATE_LONG);
+ break;
+
+ case SBW_RIGHT: {
+ int64 max_money = UINT32_MAX;
+ const Company *c;
+ FOR_ALL_COMPANIES(c) max_money = max<int64>(c->money, max_money);
+ SetDParam(0, 100LL * max_money);
+ d = GetStringBoundingBox(STR_COMPANY_MONEY);
+ } break;
+
+ default:
+ return;
+ }
+
+ d.width += padding.width;
+ d.height += padding.height;
+ *size = maxdim(d, *size);
}
virtual void DrawWidget(const Rect &r, int widget) const