[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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user