mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-01 10:46:23 -04:00
Added links colors with settings feature
This commit is contained in:
parent
5361bed037
commit
5abefa4664
23 changed files with 170 additions and 18 deletions
|
@ -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>" ;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue