aboutsummaryrefslogtreecommitdiffstats
path: root/src/libs/utils/stylehelper.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/libs/utils/stylehelper.cpp')
-rw-r--r--src/libs/utils/stylehelper.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libs/utils/stylehelper.cpp b/src/libs/utils/stylehelper.cpp
index 69b5e39556..07f526a4af 100644
--- a/src/libs/utils/stylehelper.cpp
+++ b/src/libs/utils/stylehelper.cpp
@@ -1010,7 +1010,13 @@ QFont StyleHelper::uiFont(UiElement element)
const qreal qrealPointSize = metrics.pixelSize * pixelsToPointSizeFactor;
font.setPointSizeF(qrealPointSize);
- font.setWeight(metrics.weight);
+ // Intermediate font weights can produce blurry rendering and are harder to read.
+ // For "non-retina" screens, apply the weight only for some fonts.
+ static const bool isHighDpi = qApp->devicePixelRatio() >= 2;
+ const bool setWeight = isHighDpi || element == UiElementCaptionStrong
+ || element <= UiElementH4;
+ if (setWeight)
+ font.setWeight(metrics.weight);
return font;
}