Added links colors with settings feature

This commit is contained in:
defnax 2025-06-26 22:20:38 +02:00
parent 5361bed037
commit 5abefa4664
23 changed files with 170 additions and 18 deletions

View file

@ -36,6 +36,7 @@
#include "msgs/MessageComposer.h"
#include "Posted/PostedDialog.h"
#include "util/misc.h"
#include "gui/settings/rsharesettings.h"
#include <retroshare/rsfiles.h>
#include <retroshare/rsgxsforums.h>
@ -431,6 +432,8 @@ void RetroShareLink::fromUrl(const QUrl& url)
RetroShareLink::RetroShareLink()
{
clear();
linkColor = Settings->getLinkColor();
}
RetroShareLink RetroShareLink::createFile(const QString& name, uint64_t size, const QString& hash)
@ -1132,6 +1135,22 @@ QString RetroShareLink::toHtml() const
return html;
}
QString RetroShareLink::toHtmlColored() const
{
//linkColor = Settings->getLinkColor();
QString colorstring = QString("%1;").arg(linkColor.name());
QString html = "<a href=\"" + toString() + "\"";
QString linkTitle = title();
if (!linkTitle.isEmpty()) {
html += " title=\"" + linkTitle + "\"";
}
html += "style=\"color:" + colorstring + "\"> " + niceName() + "</a>" ;
return html;
}
QString RetroShareLink::toHtmlFull() const
{
return QString("<a href=\"") + toString() + "\">" + toString() + "</a>" ;