From 0de4b76b9c76ddc4d7ee9790b70f39b7ee577ede Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Tue, 21 Aug 2018 15:22:01 +0200 Subject: macOS: Take application appearance into account when drawing glyphs macOS 10.14 uses a new font smoothing algorithm that takes the fill color into account. This means our default approach of drawing white on black to produce the alpha map will result in non-native looking text when then drawn as black on white during the final blit. As a workaround we use the application's current appearance to decide whether to draw with white or black fill, and then invert the glyph image in the latter case, producing an alpha map. This covers the most common use-cases, but longer term we should propagate the fill color all the way from the paint engine, and include it in the key for the glyph cache. At the moment we do not react to changes in the application appearance, as that seems to be buggy in general in Qt (palette/style, e.g.), and those bugs need to be weeded before we can react to the theme change with confidence. Task-number: QTBUG-68824 Change-Id: Ibbfd49fcf3a091e454009c08159f46b3499e2bd0 Reviewed-by: Simon Hausmann --- src/corelib/kernel/qcore_mac_p.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/kernel/qcore_mac_p.h') diff --git a/src/corelib/kernel/qcore_mac_p.h b/src/corelib/kernel/qcore_mac_p.h index a0802969dd..bf540c2e35 100644 --- a/src/corelib/kernel/qcore_mac_p.h +++ b/src/corelib/kernel/qcore_mac_p.h @@ -180,9 +180,10 @@ private: QString string; }; -#ifdef Q_OS_OSX +#ifdef Q_OS_MACOS Q_CORE_EXPORT QChar qt_mac_qtKey2CocoaKey(Qt::Key key); Q_CORE_EXPORT Qt::Key qt_mac_cocoaKey2QtKey(QChar keyCode); +Q_CORE_EXPORT bool qt_mac_applicationIsInDarkMode(); #endif #ifndef QT_NO_DEBUG_STREAM -- cgit v1.2.3