diff options
author | culler <culler> | 2020-05-12 16:26:04 (GMT) |
---|---|---|
committer | culler <culler> | 2020-05-12 16:26:04 (GMT) |
commit | 4437a3ec580750e757ffade154d8394ee78e1944 (patch) | |
tree | 877aae3dbf3c0c56944b4c323133c03dc3c91a82 /macosx | |
parent | 6a0fc9c04e74d9eb649442669220fd232159af4b (diff) | |
download | tk-4437a3ec580750e757ffade154d8394ee78e1944.zip tk-4437a3ec580750e757ffade154d8394ee78e1944.tar.gz tk-4437a3ec580750e757ffade154d8394ee78e1944.tar.bz2 |
Aqua: add semantic color systemLinkColor - patch from Christopher Chavez.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/README | 6 | ||||
-rw-r--r-- | macosx/tkMacOSXColor.c | 12 |
2 files changed, 14 insertions, 4 deletions
diff --git a/macosx/README b/macosx/README index c21d445..79025f1 100644 --- a/macosx/README +++ b/macosx/README @@ -275,9 +275,9 @@ but rather refers to the context in which the color should be used. Tk now provides the following semantic colors as system colors: systemTextColor, systemTextBackgroundColor, systemSelectedTextColor, systemSelectedTextBackgroundColor, systemControlTextColor, -systemDisabledControlTextColor, systemLabelColor, and -systemControlAccentColor. All of these except the last two were -present in OSX 10.0 (and those two are simulated in systems where they +systemDisabledControlTextColor, systemLabelColor, systemLinkColor, and +systemControlAccentColor. All of these except the last three were +present in OSX 10.0 (and those three are simulated in systems where they do not exist). The change in 10.14 was that the RGB color value of these colors became dynamic, meaning that the color value can change when the application appearance changes. In particular, when a user diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 6f55130..924eebf 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -213,10 +213,11 @@ static const struct SystemColorMapEntry systemColorMap[] = { { "ControlAccentColor", semantic, 8 }, /* 182 */ /* Apple's SecondaryLabelColor is the same as their LabelColor so we roll our own. */ { "SecondaryLabelColor", ttkBackground, 14 }, /* 183 */ + { "LinkColor", semantic, 9 }, /* 184 */ { NULL, 0, 0 } }; #define FIRST_SEMANTIC_COLOR 166 -#define MAX_PIXELCODE 183 +#define MAX_PIXELCODE 184 /* *---------------------------------------------------------------------- @@ -381,6 +382,15 @@ SetCGColorComponents( colorUsingColorSpace: sRGB]; } break; + case 9: + if ([NSApp macMinorVersion] >= 10) { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 + color = [[NSColor linkColor] colorUsingColorSpace:sRGB]; +#endif + } else { + color = [[NSColor blueColor] colorUsingColorSpace:sRGB]; + } + break; default: if ([NSApp macMinorVersion] >= 10) { #if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 |