Details
-
Task
-
Resolution: Done
-
P1: Critical
-
5.6.3, 5.9.6, 5.11.1
Description
Another year, another version of macOS is out breaking our Qt. The most significant change this year is the addition of dark mode and accent colors in Qt. A great share of this can be fixed in the system palette.
Accent color changes are notified through NSSystemColorsDidChangeNotification which we are already plugged into in QCocoaTheme for changes in selection color. However, as we will see, the current logic is not enough for getting the proper palette colors.
Dark/light mode changes are not directly notified to the application. It is possible to do KVO on NSApp.effectiveAppearance but reading the proper color values can only be done in specific places. This is (probably) because each NSView can have its appearance set independently.
The AppKit page on dark mode support specifies that the correct NSColor values can only be read from the following NSView methods:
Which means that any palette update must be done while the methods above are being called. This is quite different from what we had in the past with NSSystemColorsDidChangeNotification and introduces a coupling between QNSView and QCocoaTheme.
There are also issues within QMacStyle. Most notably, the native controls we render on the backing store retain their previous appearance even after the system appearance has switched. This is not related to control caching, as disabling it doesn't give the expected results.
Another issue in QMacStyle is that NSBox, which we use to render frames such as in QTabView or QFrame, doesn't draw anymore.
Attachments
Issue Links
- relates to
-
QTBUG-68989 Qt Quick does not rate limit on macOS 10.14 when using the threaded render loop
- Closed
-
QTBUG-68850 Qt Applications are not usable under macOS Mojave with dark theme
- Closed
-
QTBUG-69040 tst_qquickpositioners::test_mirroring keeps failing in qtdeclarative/dev integration on OSX 10.11
- Closed
-
QTBUG-70346 Qt Examples Dark Mode Audit (Mojave)
- Closed
- resulted in
-
QTBUG-71279 Adding stylesheet to QSpinBox causes a frame to be drawn to the value part
- Closed