diff --git a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp
index 541cecac0..1ad2e03df 100644
--- a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp
+++ b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.cpp
@@ -34,6 +34,7 @@
#include "util/qtthreadsutils.h"
#include "util/HandleRichText.h"
#include "gui/Identity/IdDialog.h"
+#include "gui/settings/rsharesettings.h"
#include "gui/MainWindow.h"
#include "ui_BoardPostDisplayWidget_compact.h"
@@ -235,8 +236,10 @@ void BoardPostDisplayWidgetBase::baseSetup()
if (urlOkay)
{
QString siteurl = url.toEncoded();
+ linkColor = Settings->getLinkColor();
- label->setStyleSheet("text-decoration: underline; color:#2255AA;");
+ QString colorstring = QString("%1;").arg(linkColor.name());
+ label->setStyleSheet("text-decoration: underline; color:" + colorstring );
label->setCursor(QCursor(Qt::PointingHandCursor));
label->setToolTip(siteurl);
diff --git a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.h b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.h
index 731ddc9da..ff17df272 100644
--- a/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.h
+++ b/retroshare-gui/src/gui/Posted/BoardPostDisplayWidget.h
@@ -107,6 +107,8 @@ signals:
protected:
RsPostedPost mPost;
uint8_t mDisplayFlags;
+private:
+ QColor linkColor;
};
class BoardPostDisplayWidget_compact : public BoardPostDisplayWidgetBase
@@ -146,6 +148,8 @@ protected:
void setup() override; // to be overloaded by the different views
private:
+ QColor linkColor;
+
/** Qt Designer generated object */
Ui::BoardPostDisplayWidget_compact *ui;
};
diff --git a/retroshare-gui/src/gui/Posted/PostedCardView.cpp b/retroshare-gui/src/gui/Posted/PostedCardView.cpp
index 9824cfda2..0ef21e436 100644
--- a/retroshare-gui/src/gui/Posted/PostedCardView.cpp
+++ b/retroshare-gui/src/gui/Posted/PostedCardView.cpp
@@ -229,9 +229,14 @@ void PostedCardView::fill()
if (urlOkay)
{
+ linkColor = Settings->getLinkColor();
+ QString colorstring = QString("%1;").arg(linkColor.name());
+
QString urlstr = QString(" ");
+ urlstr += QString("\" > ");
urlstr += messageName();
urlstr += QString(" ");
diff --git a/retroshare-gui/src/gui/Posted/PostedCardView.h b/retroshare-gui/src/gui/Posted/PostedCardView.h
index 0f4f5f2ab..aeb0f19b6 100644
--- a/retroshare-gui/src/gui/Posted/PostedCardView.h
+++ b/retroshare-gui/src/gui/Posted/PostedCardView.h
@@ -57,6 +57,8 @@ protected:
void toggleNotes() override;
private:
+ QColor linkColor;
+
/** Qt Designer generated object */
Ui::PostedCardView *ui;
};
diff --git a/retroshare-gui/src/gui/Posted/PostedItem.cpp b/retroshare-gui/src/gui/Posted/PostedItem.cpp
index 8f1cddf7d..8203d07ca 100644
--- a/retroshare-gui/src/gui/Posted/PostedItem.cpp
+++ b/retroshare-gui/src/gui/Posted/PostedItem.cpp
@@ -34,6 +34,7 @@
#include "util/HandleRichText.h"
#include "gui/MainWindow.h"
#include "gui/Identity/IdDialog.h"
+#include "gui/settings/rsharesettings.h"
#include "PhotoView.h"
#include "gui/Posted/PostedDialog.h"
#include "ui_PostedItem.h"
@@ -527,7 +528,6 @@ void PostedItem::fill()
// The only combination that seems to work: load as EncodedUrl, extract toEncoded().
QByteArray urlarray(mPost.mLink.c_str());
QUrl url = QUrl::fromEncoded(urlarray.trimmed());
- QString urlstr = "Invalid Link";
QString sitestr = "Invalid Link";
bool urlOkay = url.isValid();
@@ -546,9 +546,14 @@ void PostedItem::fill()
if (urlOkay)
{
- urlstr = QString("getLinkColor();
+ QString colorstring = QString("%1;").arg(linkColor.name());
+
+ QString urlstr = QString(" ");
+ urlstr += QString("\" > ");
urlstr += messageName();
urlstr += QString(" ");
diff --git a/retroshare-gui/src/gui/Posted/PostedItem.h b/retroshare-gui/src/gui/Posted/PostedItem.h
index a2f432dc0..a6133f9d8 100644
--- a/retroshare-gui/src/gui/Posted/PostedItem.h
+++ b/retroshare-gui/src/gui/Posted/PostedItem.h
@@ -119,6 +119,8 @@ private slots:
void toggleNotes() override;
private:
+ QColor linkColor;
+
/** Qt Designer generated object */
Ui::PostedItem *ui;
};
diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp
index 9245706d1..2c7add2ef 100644
--- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp
+++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.cpp
@@ -908,7 +908,7 @@ void PostedListWidgetWithModel::insertBoardDetails(const RsPostedGroup& group)
ui->infoAdministrator->setId(group.mMeta.mAuthorId) ;
link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
- ui->infoAdministrator->setText(link.toHtml());
+ ui->infoAdministrator->setText(link.toHtmlColored());
ui->createdinfolabel->setText(DateTime::formatLongDateTime(group.mMeta.mPublishTs));
diff --git a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui
index 734c4a233..585a88546 100644
--- a/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui
+++ b/retroshare-gui/src/gui/Posted/PostedListWidgetWithModel.ui
@@ -46,7 +46,7 @@
-
-
+
@@ -54,7 +54,7 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;">
+</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:13pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Description</span></p></body></html>
@@ -619,6 +619,11 @@ p, li { white-space: pre-wrap; }
1
+
+ RSTextBrowser
+ QTextBrowser
+ gui/common/RSTextBrowser.h
+
diff --git a/retroshare-gui/src/gui/RetroShareLink.cpp b/retroshare-gui/src/gui/RetroShareLink.cpp
index 0001cd9bc..2b4e37b0a 100644
--- a/retroshare-gui/src/gui/RetroShareLink.cpp
+++ b/retroshare-gui/src/gui/RetroShareLink.cpp
@@ -36,6 +36,7 @@
#include "msgs/MessageComposer.h"
#include "Posted/PostedDialog.h"
#include "util/misc.h"
+#include "gui/settings/rsharesettings.h"
#include
#include
@@ -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 = " " + niceName() + "" ;
+
+ return html;
+}
+
QString RetroShareLink::toHtmlFull() const
{
return QString("" + toString() + "" ;
diff --git a/retroshare-gui/src/gui/RetroShareLink.h b/retroshare-gui/src/gui/RetroShareLink.h
index 61c794b11..c32551c6f 100644
--- a/retroshare-gui/src/gui/RetroShareLink.h
+++ b/retroshare-gui/src/gui/RetroShareLink.h
@@ -41,6 +41,7 @@
#include
#include
#include
+#include
#include
@@ -138,6 +139,8 @@ class RetroShareLink
QString toHtmlSize() const ;
+ QString toHtmlColored() const;
+
QUrl toUrl() const ;
bool operator==(const RetroShareLink& l) const { return _type == l._type && _hash == l._hash ; }
@@ -176,6 +179,7 @@ class RetroShareLink
time_t _time_stamp ; // time stamp at which the link will expire.
QString _radix_group_data;
uint32_t _count ;
+ QColor linkColor;
unsigned int _subType; // for general use as sub type for _type (RSLINK_SUBTYPE_...)
};
diff --git a/retroshare-gui/src/gui/common/MimeTextEdit.cpp b/retroshare-gui/src/gui/common/MimeTextEdit.cpp
index 3d3398b0c..6d51bafc2 100644
--- a/retroshare-gui/src/gui/common/MimeTextEdit.cpp
+++ b/retroshare-gui/src/gui/common/MimeTextEdit.cpp
@@ -33,6 +33,7 @@
#include "util/HandleRichText.h"
#include "gui/RetroShareLink.h"
#include "util/imageutil.h"
+#include "gui/settings/rsharesettings.h"
#include
@@ -44,6 +45,10 @@ MimeTextEdit::MimeTextEdit(QWidget *parent)
mForceCompleterShowNextKeyEvent = false;
highliter = new RsSyntaxHighlighter(this);
mOnlyPlainText = false;
+
+ linkColor = Settings->getLinkColor();
+ QString sheet = QString::fromLatin1("a { text-decoration: underline; color: %1 }").arg(linkColor.name());
+ document()->setDefaultStyleSheet(sheet);
}
bool MimeTextEdit::canInsertFromMimeData(const QMimeData* source) const
diff --git a/retroshare-gui/src/gui/common/MimeTextEdit.h b/retroshare-gui/src/gui/common/MimeTextEdit.h
index b575c1ac9..0270e0f66 100644
--- a/retroshare-gui/src/gui/common/MimeTextEdit.h
+++ b/retroshare-gui/src/gui/common/MimeTextEdit.h
@@ -91,6 +91,7 @@ private:
RsSyntaxHighlighter *highliter;
bool mOnlyPlainText;
int mMaxBytes = -1; //limit content size, for pasting images
+ QColor linkColor;
};
#endif // MIMETEXTEDIT_H
diff --git a/retroshare-gui/src/gui/common/RSTextBrowser.cpp b/retroshare-gui/src/gui/common/RSTextBrowser.cpp
index c11d4edef..14a15ab02 100644
--- a/retroshare-gui/src/gui/common/RSTextBrowser.cpp
+++ b/retroshare-gui/src/gui/common/RSTextBrowser.cpp
@@ -23,6 +23,7 @@
#include "RSImageBlockWidget.h"
#include "gui/common/FilesDefs.h"
#include "util/imageutil.h"
+#include "gui/settings/rsharesettings.h"
#include //To get RsAccounts
@@ -50,6 +51,8 @@ RSTextBrowser::RSTextBrowser(QWidget *parent) :
highlighter = new RsSyntaxHighlighter(this);
+ updateLinkColor();
+
connect(this, SIGNAL(anchorClicked(QUrl)), this, SLOT(linkClicked(QUrl)));
}
@@ -359,3 +362,18 @@ void RSTextBrowser::copyImage()
QTextCursor cursor = cursorForPosition(point);
ImageUtil::copyImage(window(), cursor);
}
+
+void RSTextBrowser::showEvent(QShowEvent *event)
+{
+ if (!event->spontaneous()) {
+ updateLinkColor();
+ }
+}
+
+void RSTextBrowser::updateLinkColor()
+{
+ linkColor = Settings->getLinkColor();
+ QString sheet = QString::fromLatin1("a { text-decoration: underline; color: %1 }").arg(linkColor.name());
+ document()->setDefaultStyleSheet(sheet);
+
+}
diff --git a/retroshare-gui/src/gui/common/RSTextBrowser.h b/retroshare-gui/src/gui/common/RSTextBrowser.h
index a10a2b30a..f1de40323 100644
--- a/retroshare-gui/src/gui/common/RSTextBrowser.h
+++ b/retroshare-gui/src/gui/common/RSTextBrowser.h
@@ -60,6 +60,8 @@ public:
QMenu *createStandardContextMenuFromPoint(const QPoint &widgetPos);
+ virtual void showEvent(QShowEvent *) ;
+
Q_SIGNALS:
void calculateContextMenuActions();
@@ -74,6 +76,7 @@ private slots:
void viewSource();
void saveImage();
void copyImage();
+ void updateLinkColor();
protected:
void paintEvent(QPaintEvent *event);
@@ -89,6 +92,8 @@ private:
RSImageBlockWidget *mImageBlockWidget;
bool mLinkClickActive;
RsSyntaxHighlighter *highlighter;
+ QColor linkColor;
+
QList mContextMenuActions;
#ifdef RSTEXTBROWSER_CHECKIMAGE_DEBUG
QRect mCursorRectStart;
diff --git a/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp b/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp
index 57adbb39d..d4c0ba1f0 100644
--- a/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp
+++ b/retroshare-gui/src/gui/feeds/BoardsCommentsItem.cpp
@@ -464,7 +464,7 @@ void BoardsCommentsItem::fill()
//ui->titleLabel->setText(link.toHtml());
RetroShareLink msgLink = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_POSTED, mPost.mMeta.mGroupId, mPost.mMeta.mMsgId, messageName());
- ui->subjectLabel->setText(msgLink.toHtml());
+ ui->subjectLabel->setText(msgLink.toHtmlColored());
mInFill = true;
diff --git a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp
index 5b0e0b264..45531f809 100644
--- a/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp
+++ b/retroshare-gui/src/gui/feeds/ChannelsCommentsItem.cpp
@@ -388,7 +388,7 @@ void ChannelsCommentsItem::fill(bool missing_post)
if(missing_post)
ui->subjectLabel->setText("[" + QObject::tr("Missing channel post")+"]");
else
- ui->subjectLabel->setText(msgLink.toHtml());
+ ui->subjectLabel->setText(msgLink.toHtmlColored());
ui->readButton->hide();
diff --git a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp
index a6213e740..56d83af8a 100644
--- a/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp
+++ b/retroshare-gui/src/gui/feeds/GxsChannelGroupItem.cpp
@@ -169,7 +169,7 @@ void GxsChannelGroupItem::fill()
#endif
RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_CHANNEL, mGroup.mMeta.mGroupId, groupName());
- ui->nameLabel->setText(link.toHtml());
+ ui->nameLabel->setText(link.toHtmlColored());
ui->descLabel->setText(QString::fromUtf8(mGroup.mDescription.c_str()));
diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp
index 17036a15e..a397aecff 100644
--- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp
+++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.cpp
@@ -490,12 +490,12 @@ void GxsChannelPostItem::fill()
title = tr("Channel Feed") + ": ";
RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_CHANNEL, mPost.mMeta.mGroupId, groupName());
- title += link.toHtml();
+ title += link.toHtmlColored();
ui->titleLabel->setText(title);
msgText = tr("Post") + ": ";
RetroShareLink msgLink = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_CHANNEL, mPost.mMeta.mGroupId, mPost.mMeta.mMsgId, messageName());
- msgText += msgLink.toHtml();
+ msgText += msgLink.toHtmlColored();
ui->subjectLabel->setText(msgText);
if (IS_GROUP_SUBSCRIBED(mGroupMeta.mSubscribeFlags) || IS_GROUP_ADMIN(mGroupMeta.mSubscribeFlags))
diff --git a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp
index 663951a6c..e31705453 100644
--- a/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp
+++ b/retroshare-gui/src/gui/feeds/GxsForumGroupItem.cpp
@@ -181,7 +181,7 @@ void GxsForumGroupItem::fill()
#endif
RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_FORUM, mGroup.mMeta.mGroupId, groupName());
- ui->nameLabel->setText(link.toHtml());
+ ui->nameLabel->setText(link.toHtmlColored());
ui->descLabel->setText(QString::fromUtf8(mGroup.mDescription.c_str()));
diff --git a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp
index f4d091179..3fc15304d 100644
--- a/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp
+++ b/retroshare-gui/src/gui/feeds/GxsForumMsgItem.cpp
@@ -328,7 +328,7 @@ void GxsForumMsgItem::fillParentMessage()
ui->parentFrame->hide();
RetroShareLink linkParent = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, mParentMessage.mMeta.mGroupId, mParentMessage.mMeta.mMsgId, QString::fromUtf8(mParentMessage.mMeta.mMsgName.c_str()));
- ui->parentSubLabel->setText(linkParent.toHtml());
+ ui->parentSubLabel->setText(linkParent.toHtmlColored());
ui->parentMsgLabel->setText(RsHtml().formatText(NULL, QString::fromUtf8(mParentMessage.mMsg.c_str()), RSHTML_FORMATTEXT_EMBED_SMILEYS | RSHTML_FORMATTEXT_EMBED_LINKS));
ui->parentNameLabel->setId(mParentMessage.mMeta.mAuthorId);
@@ -358,7 +358,7 @@ void GxsForumMsgItem::fillMessage()
QString title = tr("Forum Feed") + ": ";
RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_FORUM, mMessage.mMeta.mGroupId, groupName());
- title += link.toHtml();
+ title += link.toHtmlColored();
ui->titleLabel->setText(title);
setReadStatus(IS_MSG_NEW(mMessage.mMeta.mMsgStatus), IS_MSG_UNREAD(mMessage.mMeta.mMsgStatus) || IS_MSG_NEW(mMessage.mMeta.mMsgStatus));
@@ -379,14 +379,14 @@ void GxsForumMsgItem::fillMessage()
ui->currNameLabel->setId(mMessage.mMeta.mAuthorId);
RetroShareLink msgLink = RetroShareLink::createGxsMessageLink(RetroShareLink::TYPE_FORUM, mMessage.mMeta.mGroupId, mMessage.mMeta.mMsgId, messageName());
- ui->currSubLabel->setText(msgLink.toHtml());
+ ui->currSubLabel->setText(msgLink.toHtmlColored());
if (wasExpanded() || ui->expandFrame->isVisible())
fillExpandFrame();
ui->timestamplabel->setText(DateTime::formatLongDateTime(mMessage.mMeta.mPublishTs));
/* header stuff */
- ui->subjectLabel->setText(msgLink.toHtml());
+ ui->subjectLabel->setText(msgLink.toHtmlColored());
if (mIsHome)
{
diff --git a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp
index f4abafb08..f73ea45ec 100644
--- a/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp
+++ b/retroshare-gui/src/gui/feeds/PostedGroupItem.cpp
@@ -148,7 +148,7 @@ void PostedGroupItem::fill()
// No link type at this moment
RetroShareLink link = RetroShareLink::createGxsGroupLink(RetroShareLink::TYPE_POSTED, mGroup.mMeta.mGroupId, groupName());
- ui->nameLabel->setText(link.toHtml());
+ ui->nameLabel->setText(link.toHtmlColored());
// ui->nameLabel->setText(groupName());
ui->descLabel->setText(QString::fromUtf8(mGroup.mDescription.c_str()));
diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp
index 18aa2ad17..22d372713 100644
--- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp
+++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.cpp
@@ -1327,7 +1327,7 @@ void GxsChannelPostsWidgetWithModel::insertChannelDetails(const RsGxsChannelGrou
if(!group.mMeta.mAuthorId.isNull())
{
RetroShareLink link = RetroShareLink::createMessage(group.mMeta.mAuthorId, "");
- ui->infoAdministrator->setText(link.toHtml());
+ ui->infoAdministrator->setText(link.toHtmlColored());
}
else
ui->infoAdministrator->setText("[No contact author]");
diff --git a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui
index 2740b4654..f7c63d524 100644
--- a/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui
+++ b/retroshare-gui/src/gui/gxschannels/GxsChannelPostsWidgetWithModel.ui
@@ -397,12 +397,12 @@
-
-
+
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
p, li { white-space: pre-wrap; }
-</style></head><body style=" font-family:'.AppleSystemUIFont'; font-size:13pt; font-weight:400; font-style:normal;">
+</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:13pt; font-weight:400; font-style:normal;">
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-family:'MS Shell Dlg 2'; font-size:8pt;">Description</span></p></body></html>
@@ -548,7 +548,7 @@ p, li { white-space: pre-wrap; }
-
-
+
true
@@ -679,6 +679,11 @@ p, li { white-space: pre-wrap; }
QToolButton
gui/common/SubscribeToolButton.h
+
+ RSTextBrowser
+ QTextBrowser
+ gui/common/RSTextBrowser.h
+
GxsCommentDialog
QWidget
diff --git a/retroshare-gui/src/gui/msgs/MessageWidget.cpp b/retroshare-gui/src/gui/msgs/MessageWidget.cpp
index 0d2e934f2..2ba5e8672 100644
--- a/retroshare-gui/src/gui/msgs/MessageWidget.cpp
+++ b/retroshare-gui/src/gui/msgs/MessageWidget.cpp
@@ -704,7 +704,7 @@ void MessageWidget::fill(const std::string &msgId)
}
else
{
- ui.fromText->setText(link.toHtml());
+ ui.fromText->setText(link.toHtmlColored());
ui.fromText->setToolTip(tooltip_string) ;
if (toolButtonReply) toolButtonReply->setEnabled(true);
}
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.cpp b/retroshare-gui/src/gui/settings/AppearancePage.cpp
index 2aecd6024..481c0850d 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.cpp
+++ b/retroshare-gui/src/gui/settings/AppearancePage.cpp
@@ -39,6 +39,7 @@
#include "util/misc.h"
#include
+#include
#include
#include
#include
@@ -363,6 +364,11 @@ void AppearancePage::load()
whileBlocking(ui.checkBoxShowSystrayOnStatus)->setChecked(Settings->valueFromGroup("StatusBar", "ShowSysTrayOnStatusBar", QVariant(false)).toBool());
whileBlocking(ui.minimumFontSize_SB)->setValue(Settings->getFontSize());
+
+ rgbLinkColor=Settings->getLinkColor();
+ QPixmap colorpix(24, 24);
+ colorpix.fill(rgbLinkColor);
+ ui.linkColorButton->setIcon(colorpix);
}
void AppearancePage::updateFontSize()
@@ -371,3 +377,26 @@ void AppearancePage::updateFontSize()
NotifyQt::getInstance()->notifySettingsChanged();
}
+
+void AppearancePage::on_linkColorButton_clicked()
+{
+ bool ok;
+ QRgb color = QColorDialog::getRgba(rgbLinkColor, &ok, window());
+ if (ok) {
+ rgbLinkColor=color;
+ QPixmap pix(24, 24);
+ pix.fill(color);
+ ui.linkColorButton->setIcon(pix);
+ Settings->setLinkColor(rgbLinkColor);
+ }
+}
+
+void AppearancePage::on_resetButton_clicked()
+{
+ QRgb color = QString::number(QColor(3, 155, 198).rgba()).toUInt();
+ defaultColor = color;
+ QPixmap pix(24, 24);
+ pix.fill(color);
+ ui.linkColorButton->setIcon(pix);
+ Settings->setLinkColor(defaultColor);
+}
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.h b/retroshare-gui/src/gui/settings/AppearancePage.h
index 741bd752e..9e8e7e2fc 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.h
+++ b/retroshare-gui/src/gui/settings/AppearancePage.h
@@ -73,9 +73,15 @@ private slots:
void updateStyle() ;
void updateFontSize();
+ void on_linkColorButton_clicked();
+ void on_resetButton_clicked();
+
private:
void switch_status(MainWindow::StatusElement s,const QString& key,bool b);
+ QRgb rgbLinkColor;
+ QRgb defaultColor;
+
/** Qt Designer generated object */
Ui::AppearancePage ui;
};
diff --git a/retroshare-gui/src/gui/settings/AppearancePage.ui b/retroshare-gui/src/gui/settings/AppearancePage.ui
index 13dc7a48e..902329637 100755
--- a/retroshare-gui/src/gui/settings/AppearancePage.ui
+++ b/retroshare-gui/src/gui/settings/AppearancePage.ui
@@ -71,7 +71,92 @@
- -
+
-
+
+
+
+ 0
+ 64
+
+
+
+ Qt::NoContextMenu
+
+
+
+
+
+ Style
+
+
+
-
+
+
+
+ 150
+ 0
+
+
+
+ Choose RetroShare's interface style
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 215
+ 20
+
+
+
+
+
+
+
+ -
+
+
+
+ 0
+ 64
+
+
+
+ Style Sheet
+
+
+
-
+
+
+
+ 150
+ 0
+
+
+
+
+ -
+
+
+ Qt::Horizontal
+
+
+
+ 215
+ 20
+
+
+
+
+
+
+
+ -
@@ -289,8 +374,8 @@
- 188
- 96
+ 20
+ 40
@@ -298,7 +383,62 @@
- -
+
-
+
+
+ Link Color
+
+
+
-
+
+
+
+ 0
+ 0
+
+
+
+ Color of the links
+
+
+
+ -
+
+
+
+ 24
+ 24
+
+
+
+
+ 24
+ 24
+
+
+
+ Set link color
+
+
+
+
+
+
+ -
+
+
+ Reset to default color
+
+
+
+ :/icons/textedit/undo.png:/icons/textedit/undo.png
+
+
+
+
+
+
+ -
Status Bar
@@ -407,7 +547,7 @@
- -
+
-
Qt::Vertical
@@ -420,91 +560,6 @@
- -
-
-
-
- 0
- 64
-
-
-
- Qt::NoContextMenu
-
-
-
-
-
- Style
-
-
-
-
-
-
-
- 150
- 0
-
-
-
- Choose RetroShare's interface style
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 215
- 20
-
-
-
-
-
-
-
- -
-
-
-
- 0
- 64
-
-
-
- Style Sheet
-
-
-
-
-
-
-
- 150
- 0
-
-
-
-
- -
-
-
- Qt::Horizontal
-
-
-
- 215
- 20
-
-
-
-
-
-
-
@@ -514,6 +569,8 @@
-
+
+
+
diff --git a/retroshare-gui/src/gui/settings/ChatPage.ui b/retroshare-gui/src/gui/settings/ChatPage.ui
index 0f60752ac..560961cd5 100644
--- a/retroshare-gui/src/gui/settings/ChatPage.ui
+++ b/retroshare-gui/src/gui/settings/ChatPage.ui
@@ -392,6 +392,11 @@
-
+
+
+ 8
+
+
1
diff --git a/retroshare-gui/src/gui/settings/rsharesettings.cpp b/retroshare-gui/src/gui/settings/rsharesettings.cpp
index d878d6c99..0acf43287 100644
--- a/retroshare-gui/src/gui/settings/rsharesettings.cpp
+++ b/retroshare-gui/src/gui/settings/rsharesettings.cpp
@@ -1222,6 +1222,15 @@ void RshareSettings::setMessageFontSize(int value)
setValueToGroup("Message", "FontSize", value);
}
+void RshareSettings::setLinkColor(QRgb rgbValue)
+{
+ setValueToGroup("Chat", "LinkColor", QString::number(rgbValue));
+}
+QRgb RshareSettings::getLinkColor()
+{
+ return valueFromGroup("Chat", "LinkColor", QString::number(QColor(3, 155, 198).rgba())).toUInt();
+}
+
#ifdef RS_JSONAPI
bool RshareSettings::getJsonApiEnabled()
{
diff --git a/retroshare-gui/src/gui/settings/rsharesettings.h b/retroshare-gui/src/gui/settings/rsharesettings.h
index 317dedb56..73b6e9790 100644
--- a/retroshare-gui/src/gui/settings/rsharesettings.h
+++ b/retroshare-gui/src/gui/settings/rsharesettings.h
@@ -349,6 +349,9 @@ public:
int getMessageFontSize();
void setMessageFontSize(int value);
+ void setLinkColor(QRgb rgbValue);
+ QRgb getLinkColor();
+
#ifdef RS_JSONAPI
bool getJsonApiEnabled();
void setJsonApiEnabled(bool enabled);