|
|
@ -385,11 +385,8 @@ void ShowDropDownListAt(Window *w, DropDownList &&list, int selected, int button
|
|
|
|
scroll = true;
|
|
|
|
scroll = true;
|
|
|
|
uint avg_height = height / (uint)list.size();
|
|
|
|
uint avg_height = height / (uint)list.size();
|
|
|
|
|
|
|
|
|
|
|
|
/* Check at least there is space for one item. */
|
|
|
|
/* Fit the list; create at least one row, even if there is no height available. */
|
|
|
|
assert(available_height >= avg_height);
|
|
|
|
uint rows = std::max<uint>(available_height / avg_height, 1);
|
|
|
|
|
|
|
|
|
|
|
|
/* Fit the list. */
|
|
|
|
|
|
|
|
uint rows = available_height / avg_height;
|
|
|
|
|
|
|
|
height = rows * avg_height;
|
|
|
|
height = rows * avg_height;
|
|
|
|
|
|
|
|
|
|
|
|
/* Add space for the scrollbar. */
|
|
|
|
/* Add space for the scrollbar. */
|
|
|
|