diff options
author | Alessandro Portale <alessandro.portale@qt.io> | 2024-04-11 17:11:56 +0200 |
---|---|---|
committer | Alessandro Portale <alessandro.portale@qt.io> | 2024-05-02 15:52:11 +0000 |
commit | a0b19d9fba713232527d84a7c124e335f567678f (patch) | |
tree | 9ab408506fd91b8380257fefd8905dc5e948ceaf /src/libs | |
parent | d3fb3a163c97dfa3a2c9b41dbdd0307522968628 (diff) |
Welcome: Restore legibility
After the release of Qt Creator 13.0.0, a couple of bug reports and
comments regarding reduced legibility appeared.
They boil down to:
1) Text appears blurry
2) Text is too small
3) Text contrast is too low
This change fixes the blurryness by setting less custom font weights for
non-HighDpi systems in StyleHelper::uiFont().
Bigger texts are used for the "Session" and "Recent Project" delegates.
The text contrast is being increased by making Token_Text_Accent darker
for light themes and brighter for dark themes.
Token_Background_Muted, which is used as background color is made a bit
brighter for light themes.
Fixes: QTCREATORBUG-30579
Fixes: QTCREATORBUG-30637
Fixes: QTCREATORBUG-30650
Change-Id: I8eeb9db6854a19b0de0bcee14b10e2ef66234e06
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: hjk <hjk@qt.io>
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; } |