mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-20 05:11:02 -04:00
Merge 1b3c316d82
into ddb4300a60
This commit is contained in:
commit
01ba8d55b2
30 changed files with 307 additions and 115 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -229,9 +229,14 @@ void PostedCardView::fill()
|
|||
|
||||
if (urlOkay)
|
||||
{
|
||||
linkColor = Settings->getLinkColor();
|
||||
QString colorstring = QString("%1;").arg(linkColor.name());
|
||||
|
||||
QString urlstr = QString("<a href=\"");
|
||||
urlstr += QString(url.toEncoded());
|
||||
urlstr += QString("\" ><span style=\" text-decoration: underline; color:#2255AA;\"> ");
|
||||
urlstr += QString("\" ><span style=\" text-decoration: underline; color:");
|
||||
urlstr += colorstring;
|
||||
urlstr += QString("\"> ");
|
||||
urlstr += messageName();
|
||||
urlstr += QString(" </span></a>");
|
||||
|
||||
|
|
|
@ -57,6 +57,8 @@ protected:
|
|||
void toggleNotes() override;
|
||||
|
||||
private:
|
||||
QColor linkColor;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::PostedCardView *ui;
|
||||
};
|
||||
|
|
|
@ -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("<a href=\"");
|
||||
linkColor = Settings->getLinkColor();
|
||||
QString colorstring = QString("%1;").arg(linkColor.name());
|
||||
|
||||
QString urlstr = QString("<a href=\"");
|
||||
urlstr += QString(url.toEncoded());
|
||||
urlstr += QString("\" ><span style=\" text-decoration: underline; color:#2255AA;\"> ");
|
||||
urlstr += QString("\" ><span style=\" text-decoration: underline; color:");
|
||||
urlstr += colorstring;
|
||||
urlstr += QString("\"> ");
|
||||
urlstr += messageName();
|
||||
urlstr += QString(" </span></a>");
|
||||
|
||||
|
|
|
@ -119,6 +119,8 @@ private slots:
|
|||
void toggleNotes() override;
|
||||
|
||||
private:
|
||||
QColor linkColor;
|
||||
|
||||
/** Qt Designer generated object */
|
||||
Ui::PostedItem *ui;
|
||||
};
|
||||
|
|
|
@ -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));
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@
|
|||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="2" column="0">
|
||||
<widget class="QTextBrowser" name="trans_Description">
|
||||
<widget class="RSTextBrowser" name="trans_Description">
|
||||
<property name="styleSheet">
|
||||
<string notr="true"/>
|
||||
</property>
|
||||
|
@ -54,7 +54,7 @@
|
|||
<string notr="true"><!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></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
|
@ -619,6 +619,11 @@ p, li { white-space: pre-wrap; }
|
|||
<header>gui/common/RSTabWidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>RSTextBrowser</class>
|
||||
<extends>QTextBrowser</extends>
|
||||
<header>gui/common/RSTextBrowser.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../icons.qrc"/>
|
||||
|
|
|
@ -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>" ;
|
||||
|
|
|
@ -41,6 +41,7 @@
|
|||
#include <QString>
|
||||
#include <QUrl>
|
||||
#include <QVector>
|
||||
#include <QColor>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
|
@ -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_...)
|
||||
};
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "util/HandleRichText.h"
|
||||
#include "gui/RetroShareLink.h"
|
||||
#include "util/imageutil.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
|
@ -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
|
||||
|
|
|
@ -91,6 +91,7 @@ private:
|
|||
RsSyntaxHighlighter *highliter;
|
||||
bool mOnlyPlainText;
|
||||
int mMaxBytes = -1; //limit content size, for pasting images
|
||||
QColor linkColor;
|
||||
};
|
||||
|
||||
#endif // MIMETEXTEDIT_H
|
||||
|
|
|
@ -23,6 +23,7 @@
|
|||
#include "RSImageBlockWidget.h"
|
||||
#include "gui/common/FilesDefs.h"
|
||||
#include "util/imageutil.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
|
||||
#include <retroshare/rsinit.h> //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);
|
||||
|
||||
}
|
||||
|
|
|
@ -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<QAction*> mContextMenuActions;
|
||||
#ifdef RSTEXTBROWSER_CHECKIMAGE_DEBUG
|
||||
QRect mCursorRectStart;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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()));
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
|
@ -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()));
|
||||
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -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()));
|
||||
|
|
|
@ -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]");
|
||||
|
|
|
@ -397,12 +397,12 @@
|
|||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="infoDescription">
|
||||
<widget class="RSTextBrowser" name="infoDescription">
|
||||
<property name="html">
|
||||
<string notr="true"><!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></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags">
|
||||
|
@ -548,7 +548,7 @@ p, li { white-space: pre-wrap; }
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextBrowser" name="postDetails_TE">
|
||||
<widget class="RSTextBrowser" name="postDetails_TE">
|
||||
<property name="openExternalLinks">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
@ -679,6 +679,11 @@ p, li { white-space: pre-wrap; }
|
|||
<extends>QToolButton</extends>
|
||||
<header>gui/common/SubscribeToolButton.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>RSTextBrowser</class>
|
||||
<extends>QTextBrowser</extends>
|
||||
<header>gui/common/RSTextBrowser.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>GxsCommentDialog</class>
|
||||
<extends>QWidget</extends>
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
#include "util/misc.h"
|
||||
|
||||
#include <QAbstractItemView>
|
||||
#include <QColorDialog>
|
||||
#include <QComboBox>
|
||||
#include <QCheckBox>
|
||||
#include <QDir>
|
||||
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
};
|
||||
|
|
|
@ -71,7 +71,92 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpStyle">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::NoContextMenu</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Style</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="grpStyleGLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="RSComboBox" name="cmboStyle">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Choose RetroShare's interface style</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="grpStyleHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpStyleSheet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Style Sheet</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="grpStyleSheetGLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="RSComboBox" name="cmboStyleSheet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="grpStyleSheetHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" rowspan="2">
|
||||
<widget class="QGroupBox" name="grpToolBar">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
|
@ -289,8 +374,8 @@
|
|||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>188</width>
|
||||
<height>96</height>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
|
@ -298,7 +383,62 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0" colspan="2">
|
||||
<item row="4" column="1">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Link Color</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_17">
|
||||
<item>
|
||||
<widget class="QLabel" name="label_10">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Color of the links</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="linkColorButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Set link color</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QToolButton" name="resetButton">
|
||||
<property name="toolTip">
|
||||
<string>Reset to default color</string>
|
||||
</property>
|
||||
<property name="icon">
|
||||
<iconset resource="../icons.qrc">
|
||||
<normaloff>:/icons/textedit/undo.png</normaloff>:/icons/textedit/undo.png</iconset>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpStatus">
|
||||
<property name="title">
|
||||
<string>Status Bar</string>
|
||||
|
@ -407,7 +547,7 @@
|
|||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0" colspan="2">
|
||||
<item row="6" column="0" colspan="2">
|
||||
<spacer name="AppearancePageVSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
|
@ -420,91 +560,6 @@
|
|||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpStyle">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::NoContextMenu</enum>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Style</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="grpStyleGLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="RSComboBox" name="cmboStyle">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Choose RetroShare's interface style</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="grpStyleHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<widget class="QGroupBox" name="grpStyleSheet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>64</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="title">
|
||||
<string>Style Sheet</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="grpStyleSheetGLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="RSComboBox" name="cmboStyleSheet">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>150</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="grpStyleSheetHSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>215</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
|
@ -514,6 +569,8 @@
|
|||
<header>gui/common/RSComboBox.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<resources>
|
||||
<include location="../icons.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
@ -392,6 +392,11 @@
|
|||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="minimumFontSize">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>8</pointsize>
|
||||
</font>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue