Skip to content

Commit

Permalink
Do not output html tooltips on win, mac
Browse files Browse the repository at this point in the history
  • Loading branch information
ctrlaltca committed Dec 13, 2023
1 parent a071d23 commit 2a33d94
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
20 changes: 11 additions & 9 deletions src/modules/trayicon/libkvitrayicon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ static const char * idlemsgs[] = {

static const std::size_t NIDLEMSGS = sizeof(idlemsgs) / sizeof(*idlemsgs);

const QString KviTrayIconWidget::getToolTipText()
const QString KviTrayIconWidget::getToolTipText(bool bHtml)
{
QString szTmp;

Expand All @@ -225,16 +225,18 @@ const QString KviTrayIconWidget::getToolTipText()
if(!line.isEmpty())
{
if(!first)
szTmp += "<br><br>\n";
szTmp += bHtml ? "<br><br>\n" : "\n\n";
else
first = false;

line.replace(QChar('&'), "&amp;");
line.replace(QChar('<'), "&lt;");
line.replace(QChar('>'), "&gt;");
szTmp += "<b>";
if(bHtml) {
line.replace(QChar('&'), "&amp;");
line.replace(QChar('<'), "&lt;");
line.replace(QChar('>'), "&gt;");
szTmp += "<b>";
}
szTmp += b->kviWindow()->plainTextCaption();
szTmp += "</b><br>";
szTmp += bHtml ? "</b><br>" : "\n";
szTmp += line;
}
}
Expand Down Expand Up @@ -473,9 +475,9 @@ void KviTrayIconWidget::refresh()
updateIcon();

#ifdef COMPILE_KDE_SUPPORT
setToolTipSubTitle(getToolTipText());
setToolTipSubTitle(getToolTipText(true));
#else
setToolTip(getToolTipText());
setToolTip(getToolTipText(false));
#endif
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/trayicon/libkvitrayicon.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class KviTrayIconWidget final

private:
void grabActivityInfo();
const QString getToolTipText();
const QString getToolTipText(bool bHtml);
private slots:
void fillContextPopup();
void toggleParentFrame();
Expand Down

0 comments on commit 2a33d94

Please sign in to comment.