comparison mac/dw.m @ 1984:09a102c92788

Mac: Fix building on MacOS 10.7 Lion.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 02 Sep 2019 00:30:19 +0000
parents 59146d14e21e
children 8d130e45430d
comparison
equal deleted inserted replaced
1983:59146d14e21e 1984:09a102c92788
407 } 407 }
408 return 0; 408 return 0;
409 } 409 }
410 410
411 /* Returns TRUE of Mojave or later is in Dark Mode */ 411 /* Returns TRUE of Mojave or later is in Dark Mode */
412 BOOL _is_dark(NSAppearance * appearance) 412 BOOL _is_dark(id object)
413 { 413 {
414 #ifdef BUILDING_FOR_MOJAVE 414 #ifdef BUILDING_FOR_MOJAVE
415 NSAppearance *appearance = [object effectiveAppearance];
416
415 if(@available(macOS 10.14, *)) 417 if(@available(macOS 10.14, *))
416 { 418 {
417 NSAppearanceName basicAppearance = [appearance bestMatchFromAppearancesWithNames:@[ 419 NSAppearanceName basicAppearance = [appearance bestMatchFromAppearancesWithNames:@[
418 NSAppearanceNameAqua, 420 NSAppearanceNameAqua,
419 NSAppearanceNameDarkAqua]]; 421 NSAppearanceNameDarkAqua]];
2316 } 2318 }
2317 -(void)checkDark 2319 -(void)checkDark
2318 { 2320 {
2319 /* Update any system colors based on the Dark Mode */ 2321 /* Update any system colors based on the Dark Mode */
2320 _DW_COLOR_ROW_EVEN = DW_RGB_TRANSPARENT; 2322 _DW_COLOR_ROW_EVEN = DW_RGB_TRANSPARENT;
2321 if(_is_dark([self effectiveAppearance])) 2323 if(_is_dark(self))
2322 _DW_COLOR_ROW_ODD = DW_RGB(100, 100, 100); 2324 _DW_COLOR_ROW_ODD = DW_RGB(100, 100, 100);
2323 else 2325 else
2324 _DW_COLOR_ROW_ODD = DW_RGB(230, 230, 230); 2326 _DW_COLOR_ROW_ODD = DW_RGB(230, 230, 230);
2325 /* Only refresh if we've been setup already */ 2327 /* Only refresh if we've been setup already */
2326 if(titles) 2328 if(titles)