1
0
Fork 0

(svn r17998) -Fix (r17994): Use a consistent item list width.

release/1.0
alberth 2009-11-07 17:45:49 +00:00
parent 0bc03c25f4
commit c341673cd5
1 changed files with 3 additions and 2 deletions

View File

@ -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 */