Returns the width of the new tooltip text
| 139 | private: |
| 140 | // Returns the width of the new tooltip text |
| 141 | int32_t FormatTextForTooltip(const StringWithArgs& message) |
| 142 | { |
| 143 | const u8string tempString = FormatStringIDLegacy(message.str, message.args.Data()); |
| 144 | |
| 145 | StringWithArgs formattedMessage{ STR_STRING_TOOLTIP, Formatter() }; |
| 146 | formattedMessage.args.Add<const char*>(tempString.c_str()); |
| 147 | const u8string tooltipTextUnwrapped = FormatStringIDLegacy(formattedMessage.str, formattedMessage.args.Data()); |
| 148 | |
| 149 | auto textWidth = getStringWidthNewlined(tooltipTextUnwrapped, FontStyle::small); |
| 150 | textWidth = std::min(textWidth, 196); |
| 151 | |
| 152 | int32_t numLines; |
| 153 | textWidth = wrapString(tooltipTextUnwrapped, textWidth + 1, FontStyle::small, &_tooltipText, &numLines); |
| 154 | _tooltipNumLines = numLines; |
| 155 | return textWidth; |
| 156 | } |
| 157 | }; |
| 158 | |
| 159 | void WindowTooltipReset(const ScreenCoordsXY& screenCoords) |
nothing calls this directly
no test coverage detected