Work around more Solarium bugs

This commit is contained in:
Lior Halphon
2025-07-11 17:59:32 +03:00
parent aa0fe30d5c
commit 9bd84978cf
2 changed files with 18 additions and 1 deletions

View File

@@ -15,7 +15,6 @@ static double StatusBarHeight(void)
if (!ret && [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) { if (!ret && [UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad) {
ret = 32; // iPadOS is buggy af ret = 32; // iPadOS is buggy af
} }
NSLog(@"height = %f", ret);
} }
}); });
return ret; return ret;

View File

@@ -2114,3 +2114,21 @@ didReceiveNotificationResponse:(UNNotificationResponse *)response
} }
@end @end
/* +[UIColor labelColor] is broken in some contexts in iOS 26 and despite being such a critical method
Apple isn't going to fix this in time. */
@implementation UIColor(SolariumBugs)
+ (UIColor *)labelColor
{
return [UIColor colorWithDynamicProvider:^UIColor *(UITraitCollection *traitCollection) {
switch (traitCollection.userInterfaceStyle) {
case UIUserInterfaceStyleUnspecified:
case UIUserInterfaceStyleLight:
return [UIColor blackColor];
case UIUserInterfaceStyleDark:
return [UIColor whiteColor];
}
}];
}
@end