summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-11-07 17:45:49 +0000
committeralberth <alberth@openttd.org>2009-11-07 17:45:49 +0000
commitc341673cd56a0101298b60592fdc1ddcd81e9f0a (patch)
tree8ee25f282f44f1442a3c6415a518fd0b327bbee0 /src
parent0bc03c25f48b6abce53cb43d71b31334d3f5bf35 (diff)
downloadopenttd-c341673cd56a0101298b60592fdc1ddcd81e9f0a.tar.xz
(svn r17998) -Fix (r17994): Use a consistent item list width.
Diffstat (limited to 'src')
-rw-r--r--src/widgets/dropdown.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/dropdown.cpp b/src/widgets/dropdown.cpp
index 409b90966..750347c49 100644
--- a/src/widgets/dropdown.cpp
+++ b/src/widgets/dropdown.cpp
@@ -120,8 +120,9 @@ struct DropdownWindow : Window {
this->CreateNestedTree(&_dropdown_desc);
+ uint items_width = size.width - (scroll ? WD_VSCROLLBAR_WIDTH : 0);
NWidgetCore *nwi = this->GetWidget<NWidgetCore>(DDM_ITEMS);
- nwi->SetMinimalSize(size.width - (scroll ? 12 : 0), size.height + 4);
+ nwi->SetMinimalSize(items_width, size.height + 4);
nwi->colour = wi_colour;
nwi = this->GetWidget<NWidgetCore>(DDM_SCROLL);
@@ -138,7 +139,7 @@ struct DropdownWindow : Window {
int list_height = 0;
for (DropDownList::const_iterator it = list->begin(); it != list->end(); ++it) {
DropDownListItem *item = *it;
- list_height += item->Height(size.width - WD_VSCROLLBAR_WIDTH);
+ list_height += item->Height(items_width);
}
/* Capacity is the average number of items visible */