[GUI] Make UrlLabel in About styleable

The UrlLabel in the About FreeCAD box was not styleable because its
rich-text contents overrode any styling applied to it. This commit
converts it to a plain text label that can then be styled in a
stylesheet using the Gui--UrlLabel selector. If no stylesheet is
applied, the UrlLabel styles itself using the old-school blue text with
an underline, but any applied stylesheet completely overrides this
default.

This does not affect the "clickability" of a UrlLabel widget, which is
handled independently of the label's content (including its textual
hyperlink, which was and still is ignored).
This commit is contained in:
Chris Hennes
2021-02-22 16:39:26 -06:00
committed by wmayer
parent dfba396b4f
commit 0bc39982df
2 changed files with 8 additions and 1 deletions

View File

@@ -825,6 +825,10 @@ UrlLabel::UrlLabel(QWidget * parent, Qt::WindowFlags f)
{
_url = QString::fromLatin1("http://localhost");
setToolTip(this->_url);
if (qApp->styleSheet().isEmpty()) {
setStyleSheet(QString::fromLatin1("Gui--UrlLabel {color: #0000FF;text-decoration: underline;}"));
}
}
UrlLabel::~UrlLabel()