From c341673cd56a0101298b60592fdc1ddcd81e9f0a Mon Sep 17 00:00:00 2001 From: alberth Date: Sat, 7 Nov 2009 17:45:49 +0000 Subject: (svn r17998) -Fix (r17994): Use a consistent item list width. --- src/widgets/dropdown.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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(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(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 */ -- cgit v1.2.3-54-g00ecf