[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:
@@ -115,7 +115,10 @@
|
||||
<item>
|
||||
<widget class="Gui::UrlLabel" name="labelAuthor">
|
||||
<property name="text">
|
||||
<string notr="true"><html><head/><body><p><span style=" font-family: MS Shell Dlg 2; font-weight:600; text-decoration: underline; color:#0000ff;"> Unknown Application (c) Unknown Author</span></p></body></html></string>
|
||||
<string notr="true">Unknown Application (c) Unknown Author</string>
|
||||
</property>
|
||||
<property name="textFormat">
|
||||
<enum>Qt::PlainText</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
||||
@@ -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