comparison mac/dw.m @ 2101:07666f97412f

Mac: I didn't like the Xcode auto-fix... here is a better one.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Fri, 12 Jun 2020 21:02:20 +0000
parents 12a9546c3e03
children 2417bc294e30
comparison
equal deleted inserted replaced
2100:12a9546c3e03 2101:07666f97412f
12640 if([basicAppearance isEqualToString:NSAppearanceNameDarkAqua]) 12640 if([basicAppearance isEqualToString:NSAppearanceNameDarkAqua])
12641 return 3; 12641 return 3;
12642 if([basicAppearance isEqualToString:NSAppearanceNameAqua]) 12642 if([basicAppearance isEqualToString:NSAppearanceNameAqua])
12643 return DW_FEATURE_DISABLED; 12643 return DW_FEATURE_DISABLED;
12644 } 12644 }
12645 return DW_FEATURE_ENABLED;
12645 } 12646 }
12646 return DW_FEATURE_ENABLED; 12647 return DW_FEATURE_UNSUPPORTED;
12647 } 12648 }
12648 #endif 12649 #endif
12649 default: 12650 default:
12650 return DW_FEATURE_UNSUPPORTED; 12651 return DW_FEATURE_UNSUPPORTED;
12651 } 12652 }
12680 return DW_ERROR_GENERAL; 12681 return DW_ERROR_GENERAL;
12681 /* These features are supported and configurable */ 12682 /* These features are supported and configurable */
12682 #ifdef BUILDING_FOR_MOJAVE 12683 #ifdef BUILDING_FOR_MOJAVE
12683 case DW_FEATURE_DARK_MODE: 12684 case DW_FEATURE_DARK_MODE:
12684 { 12685 {
12685 /* Disabled forces the non-dark aqua theme */ 12686 if(@available(macOS 10.14, *))
12686 if(state == DW_FEATURE_DISABLED)
12687 [DWApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];
12688 /* Enabled lets the OS decide the mode */
12689 else if(state == DW_FEATURE_ENABLED || state == 2)
12690 [DWApp setAppearance:nil];
12691 /* 2 forces dark mode aqua appearance */
12692 else if(state == 3)
12693 { 12687 {
12694 if(@available(macOS 10.14, *)) 12688 /* Disabled forces the non-dark aqua theme */
12689 if(state == DW_FEATURE_DISABLED)
12690 [DWApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];
12691 /* Enabled lets the OS decide the mode */
12692 else if(state == DW_FEATURE_ENABLED || state == 2)
12693 [DWApp setAppearance:nil];
12694 /* 2 forces dark mode aqua appearance */
12695 else if(state == 3)
12695 [DWApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]]; 12696 [DWApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]];
12697 else
12698 return DW_ERROR_GENERAL;
12699 return DW_ERROR_NONE;
12696 } 12700 }
12697 else 12701 return DW_FEATURE_UNSUPPORTED;
12698 return DW_ERROR_GENERAL;
12699 return DW_ERROR_NONE;
12700 } 12702 }
12701 #endif 12703 #endif
12702 default: 12704 default:
12703 return DW_FEATURE_UNSUPPORTED; 12705 return DW_FEATURE_UNSUPPORTED;
12704 } 12706 }