mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-02 11:16:34 -04:00
Fixed to update the changed color
This commit is contained in:
parent
cbec62ccc7
commit
02f2f4e075
2 changed files with 19 additions and 3 deletions
|
@ -51,9 +51,7 @@ RSTextBrowser::RSTextBrowser(QWidget *parent) :
|
|||
|
||||
highlighter = new RsSyntaxHighlighter(this);
|
||||
|
||||
linkColor = Settings->getLinkColor();
|
||||
QString sheet = QString::fromLatin1("a { text-decoration: underline; color: %1 }").arg(linkColor.name());
|
||||
document()->setDefaultStyleSheet(sheet);
|
||||
updateLinkColor();
|
||||
|
||||
connect(this, SIGNAL(anchorClicked(QUrl)), this, SLOT(linkClicked(QUrl)));
|
||||
}
|
||||
|
@ -364,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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue