| 639 | } |
| 640 | |
| 641 | void UpdateWidgetSize(WidgetID widget, Dimension &size, [[maybe_unused]] const Dimension &padding, [[maybe_unused]] Dimension &fill, [[maybe_unused]] Dimension &resize) override |
| 642 | { |
| 643 | if (widget != WID_TT_BACKGROUND) return; |
| 644 | |
| 645 | auto str = this->text.GetDecodedString(); |
| 646 | size.width = std::min<uint>(GetStringBoundingBox(str).width, ScaleGUITrad(194)); |
| 647 | size.height = GetStringHeight(str, size.width); |
| 648 | |
| 649 | /* Increase slightly to have some space around the box. */ |
| 650 | size.width += WidgetDimensions::scaled.framerect.Horizontal() + WidgetDimensions::scaled.fullbevel.Horizontal(); |
| 651 | size.height += WidgetDimensions::scaled.framerect.Vertical() + WidgetDimensions::scaled.fullbevel.Vertical(); |
| 652 | } |
| 653 | |
| 654 | void DrawWidget(const Rect &r, WidgetID widget) const override |
| 655 | { |
nothing calls this directly
no test coverage detected