macOS: Do not partially switch light/dark when system switches

If during the runtime of Qt Creator macOS switches the system theme
between "dark" and "light", Qt Creator should not partially switch its
appearance. Since Qt Creator does not support switching the theme at
runtime, it must stay fixed on the appearance of the selected theme.

The code previously only forced Qt Creator's macOS appearance if there
was a mismatch on startup. So if you started a light (or default) Qt
Creator theme while the system was in light mode, Qt Creator's macOS
appearance stayed at the "default for the system", and if the system was
changed to dark mode, Qt Creator would follow that partially in the
styling of standard controls only.

Instead always force Qt Creator's macOS appearance.

Fixes: QTCREATORBUG-28066
Change-Id: I0eb8fcbc6cf9d2b3e548dd871b9a3e1e611c136a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Eike Ziller
2022-09-01 10:38:10 +02:00
parent 6d6346044c
commit 4c83ec2372

View File

@@ -32,8 +32,6 @@ bool currentAppearanceMatches(bool dark)
void forceMacAppearance(bool dark) void forceMacAppearance(bool dark)
{ {
if (currentAppearanceMatches(dark))
return;
#if __has_builtin(__builtin_available) #if __has_builtin(__builtin_available)
if (__builtin_available(macOS 10.14, *)) if (__builtin_available(macOS 10.14, *))
#else // Xcode 8 #else // Xcode 8