From 4437a3ec580750e757ffade154d8394ee78e1944 Mon Sep 17 00:00:00 2001 From: culler Date: Tue, 12 May 2020 16:26:04 +0000 Subject: Aqua: add semantic color systemLinkColor - patch from Christopher Chavez. --- doc/colors.n | 1 + library/demos/widget | 4 ++++ macosx/README | 6 +++--- macosx/tkMacOSXColor.c | 12 +++++++++++- 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/doc/colors.n b/doc/colors.n index 7a7b5b3..c1609b9 100644 --- a/doc/colors.n +++ b/doc/colors.n @@ -944,6 +944,7 @@ systemControlAccentColor systemControlTextColor systemDisabledControlTextColor systemLabelColor +systemLinkColor systemSelectedTextBackgroundColor systemSelectedTextColor systemTextBackgroundColor diff --git a/library/demos/widget b/library/demos/widget index fca6cfd..e543846 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -194,6 +194,10 @@ if {[winfo depth .] == 1} { -foreground blue -underline 1 .t tag configure visited -lmargin1 1c -lmargin2 1c \ -foreground #303080 -underline 1 + if {[tk windowingsystem] eq "aqua"} { + .t tag configure demo -foreground systemLinkColor + .t tag configure visited -foreground purple + } .t tag configure hot -foreground red -underline 1 } .t tag bind demo { 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 -- cgit v0.12