1
0
mirror of https://github.com/godotengine/godot.git synced 2026-01-05 19:31:35 +00:00

Use windowBackgroundColor instead of controlColor for macOS system base color

Per Apple Developer Documentation:
windowBackgroundColor: "The color to use for the window background."
controlColor: "The color to use for the flat surfaces of a control."

Godot's base_color more closely corresponds to windowBackgroundColor.
In some cases, controlColor may even return values that are not appropriate for use as a base color.
This commit is contained in:
Grublady
2024-08-01 21:49:11 -04:00
parent 134da37497
commit 2b16d4e002

View File

@@ -903,7 +903,7 @@ Color DisplayServerMacOS::get_base_color() const {
__block NSColor *color = nullptr;
if (@available(macOS 11.0, *)) {
[NSApp.effectiveAppearance performAsCurrentDrawingAppearance:^{
color = [[NSColor controlColor] colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]];
color = [[NSColor windowBackgroundColor] colorUsingColorSpace:[NSColorSpace genericRGBColorSpace]];
}];
} else {
NSAppearance *saved_appearance = [NSAppearance currentAppearance];