Commit 514a4d95 authored by Don Gagne's avatar Don Gagne

Adjust point sizes in styles

parent 9ed04b1d
...@@ -567,8 +567,32 @@ void QGCApplication::_loadCurrentStyle(void) ...@@ -567,8 +567,32 @@ void QGCApplication::_loadCurrentStyle(void)
} }
} }
if (!styles.isEmpty()) { // Now that we have the styles loaded we need to dpi adjust the font point sizes
setStyleSheet(styles);
QString dpiAdjustedStyles;
if (success) {
QTextStream styleStream(&styles, QIODevice::ReadOnly);
QRegularExpression regex("font-size:.+(\\d\\d)pt;");
while (!styleStream.atEnd()) {
QString adjustedLine;
QString line = styleStream.readLine();
QRegularExpressionMatch match = regex.match(line);
if (match.hasMatch()) {
//qDebug() << "found:" << line << match.captured(1);
adjustedLine = QString("font-size: %1pt;").arg(ScreenTools::dpiAdjustedPointSize_s(match.captured(1).toDouble()));
//qDebug() << "adjusted:" << adjustedLine;
} else {
adjustedLine = line;
}
dpiAdjustedStyles += adjustedLine;
}
}
if (!dpiAdjustedStyles.isEmpty()) {
setStyleSheet(dpiAdjustedStyles);
} }
if (!success) { if (!success) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment