forked from qt-creator/qt-creator
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>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user