mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-18 04:51:41 +00:00
Update LowContrastMode.xm
This commit is contained in:
parent
f4c800c3cd
commit
1478bb27aa
1 changed files with 13 additions and 18 deletions
|
|
@ -159,26 +159,21 @@ static BOOL pinkContrastMode() {
|
|||
%hook _ASDisplayView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
UILabel *label = [self findLabelInSubviews:self.subviews];
|
||||
if (label) {
|
||||
[self customizeLabel:label];
|
||||
}
|
||||
}
|
||||
- (UILabel *)findLabelInSubviews:(NSArray *)subviews {
|
||||
for (UIView *subview in subviews) {
|
||||
if ([subview isKindOfClass:[UILabel class]]) {
|
||||
return (UILabel *)subview;
|
||||
}
|
||||
UILabel *label = [self findLabelInSubviews:subview.subviews];
|
||||
if (label) {
|
||||
return label;
|
||||
if ([self isKindOfClass:NSClassFromString(@"ASDisplayNode")]) {
|
||||
UILabel *titleLabel = [self valueForKey:@"accessibilityLabel"];
|
||||
UIView *superview = [self valueForKey:@"superview"];
|
||||
if ([titleLabel isKindOfClass:[UILabel class]]) {
|
||||
titleLabel.textColor = [UIColor whiteColor];
|
||||
}
|
||||
if ([superview isKindOfClass:[UIView class]]) {
|
||||
for (UIView *subview in superview.subviews) {
|
||||
if ([subview isKindOfClass:[UILabel class]]) {
|
||||
UILabel *textView = (UILabel *)subview;
|
||||
textView.textColor = [UIColor whiteColor];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
- (void)customizeLabel:(UILabel *)label {
|
||||
label.textColor = [UIColor whiteColor];
|
||||
// Add any additional customizations you want for the label here
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
|
|
|||
Loading…
Reference in a new issue