summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXColor.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-05-03 21:39:42 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-05-03 21:39:42 (GMT)
commit27f50829212bbb4d1bc9f8171d9ca2f69ea00a8e (patch)
tree58c5a3e27a788a24df54cca64bcf4f8fe2cf8ee1 /macosx/tkMacOSXColor.c
parent0443d767018b5fcddfa351c46b1bc04d396d3de0 (diff)
downloadtk-27f50829212bbb4d1bc9f8171d9ca2f69ea00a8e.zip
tk-27f50829212bbb4d1bc9f8171d9ca2f69ea00a8e.tar.gz
tk-27f50829212bbb4d1bc9f8171d9ca2f69ea00a8e.tar.bz2
Add "controlAlternatingRowColor" to macosx aqua port
Diffstat (limited to 'macosx/tkMacOSXColor.c')
-rw-r--r--macosx/tkMacOSXColor.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/macosx/tkMacOSXColor.c b/macosx/tkMacOSXColor.c
index 90359a0..bafd310 100644
--- a/macosx/tkMacOSXColor.c
+++ b/macosx/tkMacOSXColor.c
@@ -23,6 +23,7 @@ static Tcl_HashTable systemColors;
static int numSystemColors;
static int rgbColorIndex;
static int controlAccentIndex;
+static int controlAlternatingRowIndex;
static int selectedTabTextIndex;
static int pressedButtonTextIndex;
static Bool useFakeAccentColor = NO;
@@ -71,6 +72,7 @@ static void initColorTable()
if ([colorName isEqualToString:@"controlAccentColor"]) {
useFakeAccentColor = YES;
} else if ( ![colorName isEqualToString:@"selectedTabTextColor"]
+ && ![colorName isEqualToString:@"controlAlternatingRowColor"]
&& ![colorName isEqualToString:@"pressedButtonTextColor"]) {
/* Uncomment to print all unsupported colors: */
/* printf("Unsupported color %s\n", colorName.UTF8String); */
@@ -148,6 +150,9 @@ static void initColorTable()
hPtr = Tcl_FindHashEntry(&systemColors, "ControlAccentColor");
entry = (SystemColorDatum *) Tcl_GetHashValue(hPtr);
controlAccentIndex = entry->index;
+ hPtr = Tcl_FindHashEntry(&systemColors, "ControlAlternatingRowColor");
+ entry = (SystemColorDatum *) Tcl_GetHashValue(hPtr);
+ controlAlternatingRowIndex = entry->index;
hPtr = Tcl_FindHashEntry(&systemColors, "SelectedTabTextColor");
entry = (SystemColorDatum *) Tcl_GetHashValue(hPtr);
selectedTabTextIndex = entry->index;
@@ -332,6 +337,15 @@ GetRGBA(
color = [[NSColor colorForControlTint: [NSColor currentControlTint]]
colorUsingColorSpace:sRGB];
#endif
+ } else if (entry->index == controlAlternatingRowIndex) {
+ /*
+ * Color which is now called alternatingContentBackgroundColor on 10.14.
+ * Taken from NSColor.controlAlternatingRowBackgroundColors (which was
+ * replaced by NSColor.alternatingContentBackgroundColors on 10.14).
+ */
+ color = [[NSColor colorWithCatalogName:@"System"
+ colorName:@"controlAlternatingRowColor"]
+ colorUsingColorSpace:sRGB];
} else if (entry->index == selectedTabTextIndex) {
if (OSVersion > 100600 && OSVersion < 110000) {
color = [[NSColor whiteColor] colorUsingColorSpace:sRGB];