Update LowContrastMode Option (uYouPlusSettings.xm)

This commit is contained in:
arichornlover 2024-09-11 20:33:25 -05:00 committed by GitHub
parent f787877e2f
commit 88f821d348
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -609,6 +609,12 @@ extern NSBundle *uYouPlusBundle();
[alert addAction:okAction];
[settingsViewController presentViewController:alert animated:YES completion:nil];
return NO;
} else if (UIScreen.mainScreen.traitCollection.userInterfaceStyle != UIUserInterfaceStyleDark) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"Light Mode Detected" message:@"LowContrastMode is only available in Dark Mode. Please switch to Dark Mode to be able to use LowContrastMode." preferredStyle:UIAlertControllerStyleAlert];
UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"OK" style:UIAlertActionStyleDefault handler:nil];
[alert addAction:okAction];
[settingsViewController presentViewController:alert animated:YES completion:nil];
return NO;
}
}
[[NSUserDefaults standardUserDefaults] setBool:enable forKey:@"lowContrastMode_enabled"];