Don't instantiate a tooltip until it's really required by the widget (setting the tooltip text won't instantiate the tooltip).
ecode:
Closes SpartanJ/ecode#64 (Fix LSP rootPath initialization).
This commit is contained in:
Martín Lucas Golini
2023-02-24 21:30:13 -03:00
parent bf367b0dcb
commit cbce68e209
7 changed files with 41 additions and 27 deletions

View File

@@ -910,7 +910,7 @@ void LSPClientPlugin::displayTooltip( UICodeEditor* editor, const LSPHover& resp
const Vector2f& position ) {
editor->setTooltipText( resp.contents[0].value );
// HACK: Gets the old font style to restore it when the tooltip is hidden
UITooltip* tooltip = editor->getTooltip();
UITooltip* tooltip = editor->createTooltip();
if ( tooltip == nullptr )
return;
mOldTextStyle = tooltip->getFontStyle();