summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-07-25 11:32:53 +0000
committeralberth <alberth@openttd.org>2009-07-25 11:32:53 +0000
commite5bfc5660d35e408de764cde63bf376fbade37c5 (patch)
tree0072a6bdabcd5ffe4b458c357bf90c825b08d031
parent36a28fe3d2ea272c412bebf5a5620b9c06b61cf8 (diff)
downloadopenttd-e5bfc5660d35e408de764cde63bf376fbade37c5.tar.xz
(svn r16952) -Codechange: Use a label for the world population in the town directory window.
-rw-r--r--src/town_gui.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/town_gui.cpp b/src/town_gui.cpp
index 3f6f228af..924d47b6d 100644
--- a/src/town_gui.cpp
+++ b/src/town_gui.cpp
@@ -497,7 +497,8 @@ enum TownDirectoryWidgets {
TDW_SORTPOPULATION,
TDW_CENTERTOWN,
TDW_SCROLLBAR,
- TDW_EMPTYBOTTOM,
+ TDW_BOTTOM_PANEL,
+ TDW_BOTTOM_TEXT,
TDW_RESIZEBOX,
};
@@ -515,12 +516,14 @@ static const NWidgetPart _nested_town_directory_widgets[] = {
EndContainer(),
NWidget(WWT_PANEL, COLOUR_BROWN, TDW_CENTERTOWN), SetMinimalSize(196, 164), SetDataTip(0x0, STR_TOWN_DIRECTORY_LIST_TOOLTIP),
SetFill(1, 0), SetResize(0, 10), EndContainer(),
+ NWidget(WWT_PANEL, COLOUR_BROWN, TDW_BOTTOM_PANEL),
+ NWidget(WWT_TEXT, COLOUR_BROWN, TDW_BOTTOM_TEXT), SetPadding(2, 0, 0, 2), SetMinimalSize(196, 12), SetFill(1, 0), SetDataTip(STR_EMPTY, STR_NULL),
+ EndContainer(),
+ EndContainer(),
+ NWidget(NWID_VERTICAL),
+ NWidget(WWT_SCROLLBAR, COLOUR_BROWN, TDW_SCROLLBAR),
+ NWidget(WWT_RESIZEBOX, COLOUR_BROWN, TDW_RESIZEBOX),
EndContainer(),
- NWidget(WWT_SCROLLBAR, COLOUR_BROWN, TDW_SCROLLBAR),
- EndContainer(),
- NWidget(NWID_HORIZONTAL),
- NWidget(WWT_PANEL, COLOUR_BROWN, TDW_EMPTYBOTTOM), SetMinimalSize(196, 12), SetFill(1, 0), EndContainer(),
- NWidget(WWT_RESIZEBOX, COLOUR_BROWN, TDW_RESIZEBOX),
EndContainer(),
};
@@ -636,9 +639,9 @@ public:
}
} break;
- case TDW_EMPTYBOTTOM:
+ case TDW_BOTTOM_TEXT:
SetDParam(0, GetWorldPopulation());
- DrawString(r.left + 3, r.right - 3, r.top + 2, STR_TOWN_POPULATION);
+ DrawString(r.left, r.right, r.top, STR_TOWN_POPULATION);
break;
}
}
@@ -671,7 +674,7 @@ public:
resize->height = d.height;
break;
}
- case TDW_EMPTYBOTTOM: {
+ case TDW_BOTTOM_TEXT: {
SetDParam(0, 1000000000); // 10^9
Dimension d = GetStringBoundingBox(STR_TOWN_POPULATION);
d.width += padding.width;