summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformtheme.h
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-03-23 14:22:22 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-03-30 19:55:21 +0100
commitc7280b33628c6a7bc26b2188f6a96c001380c889 (patch)
tree86b5227791c36efe508118d2562b6504c6f4e1c1 /src/gui/kernel/qplatformtheme.h
parenta068f2d7c9967b6e12eaf8453760d462cbce40db (diff)
CoreText: Populate all variants of theme/system fonts
We populate the various QPlatformTheme::Fonts by asking the system for the preferred font for each use-case, but that just gives us a single font descriptor with a single style and weight. If the user then tweaks the font by e.g. making it bold or italic, our font database will not have any knowledge of these variants, and will fall back to another font. To fix this we ask CoreText for all variants of each of the theme fonts, so that each of the theme font families are fully populated. The preferred way to do this on macOS 10.15/iOS 13 and above is by using the font's UI design trait. This avoids asking CoreText for private fonts by family name directly, which is not supported and may result in giving us Times or another fallback font instead. Pick-to: 6.2 6.3 Change-Id: I4aa21624df62ac09a92d7ae0bc2cdde4f6ad6e5f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
Diffstat (limited to 'src/gui/kernel/qplatformtheme.h')
-rw-r--r--src/gui/kernel/qplatformtheme.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/gui/kernel/qplatformtheme.h b/src/gui/kernel/qplatformtheme.h
index 398ea2eae1..b29d23de6c 100644
--- a/src/gui/kernel/qplatformtheme.h
+++ b/src/gui/kernel/qplatformtheme.h
@@ -192,6 +192,7 @@ public:
EditorFont,
NFonts
};
+ Q_ENUM(Font)
enum StandardPixmap { // Keep in sync with QStyle::StandardPixmap
TitleBarMenuButton,