* Determine width and height required to fully display a DropDownList * @param list The list. * @return Dimension required to display the list. */
| 379 | * @return Dimension required to display the list. |
| 380 | */ |
| 381 | Dimension GetDropDownListDimension(const DropDownList &list) |
| 382 | { |
| 383 | Dimension dim{}; |
| 384 | for (const auto &item : list) { |
| 385 | dim.height += item->Height(); |
| 386 | dim.width = std::max(dim.width, item->Width()); |
| 387 | } |
| 388 | dim.width += WidgetDimensions::scaled.dropdowntext.Horizontal(); |
| 389 | return dim; |
| 390 | } |
| 391 | |
| 392 | /** |
| 393 | * Show a drop down list. |
no test coverage detected