diff options
author | Eike Ziller <eike.ziller@qt.io> | 2024-05-06 08:14:24 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2024-05-06 08:14:24 +0200 |
commit | a79f02ca4a0375e7a8cf3b1984eb06020d2ba61b (patch) | |
tree | 8842be204010abf0eef2f247c8ec311b5dced3b2 /src/libs | |
parent | a8d6dde8e37917bf4e6304b1bcda25fc7bdc2b32 (diff) | |
parent | 732f37685ced250e35ca10ed9a4679c963f293d1 (diff) |
Merge remote-tracking branch 'origin/13.0'
Change-Id: I77d3656aec10063a90095d5299b85304692d8b32
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/utils/stylehelper.cpp | 8 |
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; } |