| 876 | } |
| 877 | |
| 878 | void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override |
| 879 | { |
| 880 | switch (widget) { |
| 881 | case WID_SA_SPRITE: |
| 882 | size.height = ScaleGUITrad(200); |
| 883 | break; |
| 884 | |
| 885 | case WID_SA_LIST: { |
| 886 | Dimension d = {}; |
| 887 | for (const auto &spritefile : GetCachedSpriteFiles()) { |
| 888 | d = maxdim(d, GetStringBoundingBox(GetString(STR_SPRITE_ALIGNER_SPRITE, spritefile->GetSimplifiedFilename(), GetParamMaxDigits(6)))); |
| 889 | } |
| 890 | size.width = d.width + padding.width; |
| 891 | fill.height = resize.height = GetCharacterHeight(FS_NORMAL) + padding.height; |
| 892 | resize.width = 1; |
| 893 | break; |
| 894 | } |
| 895 | |
| 896 | default: |
| 897 | break; |
| 898 | } |
| 899 | } |
| 900 | |
| 901 | void DrawWidget(const Rect &r, WidgetID widget) const override |
| 902 | { |
nothing calls this directly
no test coverage detected