Improve editor's tooltip. Wrapping hack should no longer be necessary.

Also some less significant improvements.
This commit is contained in:
Leandro Melo
2010-09-01 12:08:38 +02:00
parent b935bca420
commit ba876ffd48
14 changed files with 155 additions and 126 deletions

View File

@@ -142,25 +142,18 @@ void BaseHoverHandler::process(ITextEditor *editor, int pos)
{
clear();
identifyMatch(editor, pos);
decorateToolTip(editor);
decorateToolTip();
}
void BaseHoverHandler::decorateToolTip(ITextEditor *editor)
void BaseHoverHandler::decorateToolTip()
{
BaseTextEditor *baseEditor = baseTextEditor(editor);
if (!baseEditor)
return;
if (Qt::mightBeRichText(toolTip()))
setToolTip(Qt::escape(toolTip()));
if (lastHelpItemIdentified().isValid()) {
const QString &contents = lastHelpItemIdentified().extractContent(false);
if (!contents.isEmpty()) {
if (!contents.isEmpty())
appendToolTip(contents);
} else {
QString tip = Qt::escape(toolTip());
tip.prepend(QLatin1String("<nobr>"));
tip.append(QLatin1String("</nobr>"));
setToolTip(tip);
}
addF1ToToolTip();
}
}