mirror of
https://github.com/glfw/glfw.git
synced 2024-11-26 06:14:35 +00:00
Fix remaining build errors for Cocoa.
This commit is contained in:
parent
bbd5bcb7fd
commit
b5363d87d2
@ -35,19 +35,6 @@
|
|||||||
// Needed for _NSGetProgname
|
// Needed for _NSGetProgname
|
||||||
#include <crt_externs.h>
|
#include <crt_externs.h>
|
||||||
|
|
||||||
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 101000
|
|
||||||
NSAppearanceName const NSAppearanceNameVibrantLight = @"NSAppearanceNameVibrantLight";
|
|
||||||
NSAppearanceName const NSAppearanceNameVibrantDark = @"NSAppearanceNameVibrantDark";
|
|
||||||
#endif
|
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 101400
|
|
||||||
NSAppearanceName const NSAppearanceNameDarkAqua = @"NSAppearanceNameDarkAqua";
|
|
||||||
NSAppearanceName const NSAppearanceNameAccessibilityHighContrastAqua = @"NSAppearanceNameAccessibilityAqua";
|
|
||||||
NSAppearanceName const NSAppearanceNameAccessibilityHighContrastDarkAqua = @"NSAppearanceNameAccessibilityDarkAqua";
|
|
||||||
NSAppearanceName const NSAppearanceNameAccessibilityHighContrastVibrantLight = @"NSAppearanceNameAccessibilityVibrantLight";
|
|
||||||
NSAppearanceName const NSAppearanceNameAccessibilityHighContrastVibrantDark = @"NSAppearanceNameAccessibilityVibrantDark";
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Change to our application bundle's resources directory, if present
|
// Change to our application bundle's resources directory, if present
|
||||||
//
|
//
|
||||||
static void changeToResourcesDirectory(void)
|
static void changeToResourcesDirectory(void)
|
||||||
@ -211,41 +198,58 @@ void nsAppearanceToGLFWTheme(NSAppearance* appearance, GLFWtheme* theme)
|
|||||||
if ([name isEqualToString:NSAppearanceNameAqua])
|
if ([name isEqualToString:NSAppearanceNameAqua])
|
||||||
{
|
{
|
||||||
theme->baseTheme = GLFW_BASE_THEME_LIGHT;
|
theme->baseTheme = GLFW_BASE_THEME_LIGHT;
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else if ([name isEqualToString:NSAppearanceNameDarkAqua])
|
|
||||||
|
if (@available(macOS 10.10, *)) {
|
||||||
|
if ([name isEqualToString:NSAppearanceNameVibrantLight])
|
||||||
|
{
|
||||||
|
theme->baseTheme = GLFW_BASE_THEME_LIGHT;
|
||||||
|
theme->flags |= GLFW_THEME_FLAG_VIBRANT;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if ([name isEqualToString:NSAppearanceNameVibrantDark])
|
||||||
|
{
|
||||||
|
theme->baseTheme = GLFW_BASE_THEME_DARK;
|
||||||
|
theme->flags |= GLFW_THEME_FLAG_VIBRANT;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (@available(macOS 10.14, *))
|
||||||
{
|
{
|
||||||
theme->baseTheme = GLFW_BASE_THEME_DARK;
|
if ([name isEqualToString:NSAppearanceNameDarkAqua])
|
||||||
}
|
{
|
||||||
else if ([name isEqualToString:NSAppearanceNameVibrantLight])
|
theme->baseTheme = GLFW_BASE_THEME_DARK;
|
||||||
{
|
return;
|
||||||
theme->baseTheme = GLFW_BASE_THEME_LIGHT;
|
}
|
||||||
theme->flags |= GLFW_THEME_FLAG_VIBRANT;
|
if ([name isEqualToString:NSAppearanceNameAccessibilityHighContrastAqua])
|
||||||
}
|
{
|
||||||
else if ([name isEqualToString:NSAppearanceNameVibrantDark])
|
theme->baseTheme = GLFW_BASE_THEME_LIGHT;
|
||||||
{
|
theme->flags |= GLFW_THEME_FLAG_HIGH_CONTRAST;
|
||||||
theme->baseTheme = GLFW_BASE_THEME_DARK;
|
return;
|
||||||
theme->flags |= GLFW_THEME_FLAG_VIBRANT;
|
}
|
||||||
}
|
if ([name isEqualToString:NSAppearanceNameAccessibilityHighContrastDarkAqua])
|
||||||
if ([name isEqualToString:NSAppearanceNameAccessibilityHighContrastAqua])
|
{
|
||||||
{
|
theme->baseTheme = GLFW_BASE_THEME_DARK;
|
||||||
theme->baseTheme = GLFW_BASE_THEME_LIGHT;
|
theme->flags |= GLFW_THEME_FLAG_HIGH_CONTRAST;
|
||||||
theme->flags |= GLFW_THEME_FLAG_HIGH_CONTRAST;
|
return;
|
||||||
}
|
}
|
||||||
else if ([name isEqualToString:NSAppearanceNameAccessibilityHighContrastDarkAqua])
|
if ([name isEqualToString:NSAppearanceNameAccessibilityHighContrastVibrantLight])
|
||||||
{
|
{
|
||||||
theme->baseTheme = GLFW_BASE_THEME_DARK;
|
theme->baseTheme = GLFW_BASE_THEME_LIGHT;
|
||||||
theme->flags |= GLFW_THEME_FLAG_HIGH_CONTRAST;
|
theme->flags |= GLFW_THEME_FLAG_VIBRANT | GLFW_THEME_FLAG_HIGH_CONTRAST;
|
||||||
}
|
return;
|
||||||
else if ([name isEqualToString:NSAppearanceNameAccessibilityHighContrastVibrantLight])
|
}
|
||||||
{
|
if ([name isEqualToString:NSAppearanceNameAccessibilityHighContrastVibrantDark])
|
||||||
theme->baseTheme = GLFW_BASE_THEME_LIGHT;
|
{
|
||||||
theme->flags |= GLFW_THEME_FLAG_VIBRANT | GLFW_THEME_FLAG_HIGH_CONTRAST;
|
theme->baseTheme = GLFW_BASE_THEME_DARK;
|
||||||
}
|
theme->flags |= GLFW_THEME_FLAG_VIBRANT | GLFW_THEME_FLAG_HIGH_CONTRAST;
|
||||||
else if ([name isEqualToString:NSAppearanceNameAccessibilityHighContrastVibrantDark])
|
return;
|
||||||
{
|
}
|
||||||
theme->baseTheme = GLFW_BASE_THEME_DARK;
|
|
||||||
theme->flags |= GLFW_THEME_FLAG_VIBRANT | GLFW_THEME_FLAG_HIGH_CONTRAST;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
theme->baseTheme = GLFW_BASE_THEME_LIGHT;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create key code translation tables
|
// Create key code translation tables
|
||||||
|
@ -1880,7 +1880,7 @@ void _glfwSetThemeCocoa(_GLFWwindow* window, GLFWtheme* theme)
|
|||||||
{
|
{
|
||||||
if (!theme || theme->baseTheme == GLFW_BASE_THEME_DEFAULT)
|
if (!theme || theme->baseTheme == GLFW_BASE_THEME_DEFAULT)
|
||||||
{
|
{
|
||||||
[window->ns.object setAppearance:nil];
|
[(NSWindow*)window->ns.object setAppearance:nil];
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1923,7 +1923,7 @@ void _glfwSetThemeCocoa(_GLFWwindow* window, GLFWtheme* theme)
|
|||||||
}
|
}
|
||||||
|
|
||||||
NSAppearance* appearance = [NSAppearance appearanceNamed:name];
|
NSAppearance* appearance = [NSAppearance appearanceNamed:name];
|
||||||
[window->ns.object setAppearance:appearance];
|
[(NSWindow*)window->ns.object setAppearance:appearance];
|
||||||
}
|
}
|
||||||
|
|
||||||
GLFWtheme* _glfwGetThemeCocoa(_GLFWwindow* window)
|
GLFWtheme* _glfwGetThemeCocoa(_GLFWwindow* window)
|
||||||
|
Loading…
Reference in New Issue
Block a user