# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1591995740 0 # Node ID 07666f97412f7dde926038e171c0bce5fa8a3962 # Parent 12a9546c3e032f4f2a0f456b9f2db09d51e5ddba Mac: I didn't like the Xcode auto-fix... here is a better one. diff -r 12a9546c3e03 -r 07666f97412f mac/dw.m --- a/mac/dw.m Fri Jun 12 20:55:01 2020 +0000 +++ b/mac/dw.m Fri Jun 12 21:02:20 2020 +0000 @@ -12642,8 +12642,9 @@ if([basicAppearance isEqualToString:NSAppearanceNameAqua]) return DW_FEATURE_DISABLED; } - } - return DW_FEATURE_ENABLED; + return DW_FEATURE_ENABLED; + } + return DW_FEATURE_UNSUPPORTED; } #endif default: @@ -12682,21 +12683,22 @@ #ifdef BUILDING_FOR_MOJAVE case DW_FEATURE_DARK_MODE: { - /* Disabled forces the non-dark aqua theme */ - if(state == DW_FEATURE_DISABLED) - [DWApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]]; - /* Enabled lets the OS decide the mode */ - else if(state == DW_FEATURE_ENABLED || state == 2) - [DWApp setAppearance:nil]; - /* 2 forces dark mode aqua appearance */ - else if(state == 3) - { - if(@available(macOS 10.14, *)) + if(@available(macOS 10.14, *)) + { + /* Disabled forces the non-dark aqua theme */ + if(state == DW_FEATURE_DISABLED) + [DWApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]]; + /* Enabled lets the OS decide the mode */ + else if(state == DW_FEATURE_ENABLED || state == 2) + [DWApp setAppearance:nil]; + /* 2 forces dark mode aqua appearance */ + else if(state == 3) [DWApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua]]; - } - else - return DW_ERROR_GENERAL; - return DW_ERROR_NONE; + else + return DW_ERROR_GENERAL; + return DW_ERROR_NONE; + } + return DW_FEATURE_UNSUPPORTED; } #endif default: