mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-02 15:15:50 +08:00
Ref T571, follow up of font dialog for radar component
* utility function renaming "fontColorString" * added reset button to erase qss generate by font dialog * set font color as invalid as default
This commit is contained in:
committed by
Mat Sutcliffe
parent
e463689490
commit
40484a9778
@@ -121,13 +121,13 @@ namespace BlackGui
|
||||
);
|
||||
}
|
||||
|
||||
QString CStyleSheetUtility::fontColor() const
|
||||
QString CStyleSheetUtility::fontColorString() const
|
||||
{
|
||||
const QString s = this->style(fileNameFonts()).toLower();
|
||||
if (!s.contains("color:")) return "red";
|
||||
if (!s.contains("color:")) return "";
|
||||
thread_local const QRegularExpression rx("color:\\s*(#*\\w+);");
|
||||
const QString c = rx.match(s).captured(1);
|
||||
return c.isEmpty() ? "red" : c;
|
||||
return c.isEmpty() ? "" : c;
|
||||
}
|
||||
|
||||
bool CStyleSheetUtility::read()
|
||||
@@ -253,7 +253,7 @@ namespace BlackGui
|
||||
|
||||
bool CStyleSheetUtility::resetFont()
|
||||
{
|
||||
QFile fontFile(CDirectoryUtils::stylesheetsDirectory() + "/" + fileNameFontsModified());
|
||||
QFile fontFile(CFileUtils::appendFilePaths(CDirectoryUtils::stylesheetsDirectory(), fileNameFontsModified()));
|
||||
return fontFile.remove();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user