CMakePM: Do not show the same tooltip on mouse pointer change

Let's say you move the mouse left and right on the keyword, we shouldn't
flicker showing the same tooltip to the new position.

Change-Id: I45b69578d377384422535ce5f33f81bc916a42e2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Cristian Adam
2023-10-02 21:58:23 +02:00
parent 3956d5b279
commit 298921be2d

View File

@@ -476,15 +476,16 @@ void CMakeHoverHandler::identifyMatch(TextEditor::TextEditorWidget *editorWidget
helpCategory, helpCategory,
word); word);
setPriority(m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None); setPriority(!m_helpToolTip.isEmpty() ? Priority_Tooltip : Priority_None);
} }
void CMakeHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point) void CMakeHoverHandler::operateTooltip(TextEditorWidget *editorWidget, const QPoint &point)
{ {
if (!m_helpToolTip.isEmpty()) if (!m_helpToolTip.isEmpty() && toolTip() != m_helpToolTip)
Utils::ToolTip::show(point, m_helpToolTip, Qt::MarkdownText, editorWidget, m_contextHelp); Utils::ToolTip::show(point, m_helpToolTip, Qt::MarkdownText, editorWidget, m_contextHelp);
else else if (m_helpToolTip.isEmpty())
Utils::ToolTip::hide(); Utils::ToolTip::hide();
setToolTip(m_helpToolTip);
} }
// //