diff options
author | fvogel <fvogelnew1@free.fr> | 2020-07-14 20:27:14 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2020-07-14 20:27:14 (GMT) |
commit | 23e453cf42f7b994add57898e672811e97d4e4fd (patch) | |
tree | 9258c57ed9792629bfc5d103c54edb2d0d12c663 | |
parent | b0ccde46840d0f2c5fe2b0caa40095bd53e029e0 (diff) | |
download | tk-23e453cf42f7b994add57898e672811e97d4e4fd.zip tk-23e453cf42f7b994add57898e672811e97d4e4fd.tar.gz tk-23e453cf42f7b994add57898e672811e97d4e4fd.tar.bz2 |
Correctly use a system placeholder color on macOS.
-rw-r--r-- | macosx/tkMacOSXColor.c | 12 | ||||
-rw-r--r-- | macosx/tkMacOSXDefault.h | 6 |
2 files changed, 12 insertions, 6 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c index 0931d7d..9575940 100644 --- a/macosx/tkMacOSXColor.c +++ b/macosx/tkMacOSXColor.c @@ -214,10 +214,11 @@ static const struct SystemColorMapEntry systemColorMap[] = { /* Apple's SecondaryLabelColor is the same as their LabelColor so we roll our own. */ { "SecondaryLabelColor", ttkBackground, 14 }, /* 183 */ { "LinkColor", semantic, 9 }, /* 184 */ + { "PlaceholderTextColor", semantic, 10 }, /* 185 */ { NULL, 0, 0 } }; #define FIRST_SEMANTIC_COLOR 166 -#define MAX_PIXELCODE 184 +#define MAX_PIXELCODE 185 /* *---------------------------------------------------------------------- @@ -386,6 +387,15 @@ SetCGColorComponents( color = [[NSColor blueColor] colorUsingColorSpace:sRGB]; } break; + case 10: + if ([NSApp macOSVersion] >= 101000) { +#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 + color = [[NSColor placeholderTextColor] colorUsingColorSpace:sRGB]; +#endif + } else { + color = [[NSColor grayColor] colorUsingColorSpace:sRGB]; + } + break; default: if ([NSApp macOSVersion] >= 101000) { #if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 diff --git a/macosx/tkMacOSXDefault.h b/macosx/tkMacOSXDefault.h index 5675e43..c5327db 100644 --- a/macosx/tkMacOSXDefault.h +++ b/macosx/tkMacOSXDefault.h @@ -193,11 +193,7 @@ #define DEF_ENTRY_INSERT_WIDTH "1" #define DEF_ENTRY_JUSTIFY "left" #define DEF_ENTRY_PLACEHOLDER "" -#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101000 -#define DEF_ENTRY_PLACEHOLDERFG "placeholderTextColor" -#else -#define DEF_ENTRY_PLACEHOLDERFG "#b3b3b3" -#endif +#define DEF_ENTRY_PLACEHOLDERFG "systemPlaceholderTextColor" #define DEF_ENTRY_READONLY_BG_COLOR NORMAL_BG #define DEF_ENTRY_READONLY_BG_MONO WHITE #define DEF_ENTRY_RELIEF "sunken" |