Show encoded url in tooltips

This commit is contained in:
Nicolas Werner 2024-09-08 00:28:05 +02:00
parent 5ba8c79f45
commit 3b41d20506
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
3 changed files with 8 additions and 1 deletions

View file

@ -11,7 +11,7 @@ TextArea {
property alias cursorShape: cs.cursorShape
ToolTip.text: hoveredLink
ToolTip.text: Nheko.punyLink(hoveredLink)
ToolTip.visible: hoveredLink || false
background: null
bottomInset: 0

View file

@ -108,6 +108,12 @@ Nheko::openLink(QString link) const
url.toDisplayString().toStdString());
}
}
QString
Nheko::punyLink(QString link) const
{
QUrl url(link);
return url.toDisplayString(QUrl::FullyEncoded);
}
void
Nheko::setStatusMessage(QString msg) const
{

View file

@ -56,6 +56,7 @@ public:
return QFontDatabase::systemFont(QFontDatabase::FixedFont);
}
Q_INVOKABLE void openLink(QString link) const;
Q_INVOKABLE QString punyLink(QString link) const;
Q_INVOKABLE void setStatusMessage(QString msg) const;
Q_INVOKABLE void showUserSettingsPage() const;
Q_INVOKABLE void logout() const;