From cc5ce2ee0a78d1a9617a9fdb8ee58ace6c98bac0 Mon Sep 17 00:00:00 2001 From: Bryce Hackel <34104885+bhackel@users.noreply.github.com> Date: Mon, 8 Apr 2024 22:18:02 -0400 Subject: [PATCH] Theme updates 2 of 2 --- Sources/uYouPlusThemes.xm | 43 +++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/Sources/uYouPlusThemes.xm b/Sources/uYouPlusThemes.xm index f14f6f8..5c278b2 100644 --- a/Sources/uYouPlusThemes.xm +++ b/Sources/uYouPlusThemes.xm @@ -237,24 +237,46 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: - (void)didMoveToWindow { %orig; if (IS_DARK_APPEARANCE_ENABLED) { - if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; } + // + UIResponder *responder = self.nextResponder; + UIViewController *closestViewController = nil; + + while (responder != nil) { + if ([responder isKindOfClass:[UIViewController class]]) { + closestViewController = (UIViewController *)responder; + break; + } + responder = responder.nextResponder; + } + + if ([NSStringFromClass([closestViewController class]) isEqualToString:@"YTActionSheetDialogViewController"] && + (([NSStringFromClass([self.superview class]) isEqualToString:@"YTELMView"]) || + [NSStringFromClass([self.superview class]) isEqualToString:@"_ASDisplayView"] || + [NSStringFromClass([self.superview class]) isEqualToString:@"ELMView"])) { + + self.backgroundColor = [UIColor clearColor]; + } + + // Save video bottom + if ([NSStringFromClass([closestViewController class]) isEqualToString:@"YTBottomSheetController"]) { self.backgroundColor = [UIColor clearColor]; } + + // Subcriptions header + if ([NSStringFromClass([closestViewController class]) isEqualToString:@"YTMySubsFilterHeaderViewController"] && + ([NSStringFromClass([self.superview class]) isEqualToString:@"YTELMView"])) { + self.backgroundColor = [UIColor clearColor]; + } if ([self.accessibilityIdentifier isEqualToString:@"brand_promo.view"]) { self.backgroundColor = [UIColor blackColor]; } - if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = [UIColor blackColor]; } if ([self.accessibilityIdentifier isEqualToString:@"eml.topic_channel_details"]) { self.backgroundColor = [UIColor blackColor]; } if ([self.accessibilityIdentifier isEqualToString:@"eml.live_chat_text_message"]) { self.backgroundColor = [UIColor blackColor]; } - if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = [UIColor blackColor]; } if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = [UIColor blackColor]; } if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_thread"]) { self.backgroundColor = [UIColor blackColor]; } - if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; } if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor blackColor]; } if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.backgroundColor = [UIColor blackColor]; } if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor blackColor]; } if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = [UIColor blackColor]; } if ([self.accessibilityIdentifier isEqualToString:@"id.comment.timed_comments_welcome"]) { self.superview.backgroundColor = self.backgroundColor = [UIColor blackColor]; } - if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = [UIColor blackColor]; } if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.superview.backgroundColor = self.backgroundColor = [UIColor blackColor]; } if ([self.accessibilityIdentifier isEqualToString:@"id.comment.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; } - if ([self.accessibilityIdentifier hasPrefix:@"id.elements.components.overflow_menu_item_"]) { self.backgroundColor = [UIColor clearColor]; } } } %end @@ -277,7 +299,6 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha: %orig; if (IS_DARK_APPEARANCE_ENABLED) { self.backgroundColor = raisedColor; - // self.subviews[1].backgroundColor = raisedColor; self.superview.backgroundColor = raisedColor; } } @@ -588,7 +609,13 @@ UIColor *customHexColor; # pragma mark - OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e -%group gOLEDKB +%group gOLEDKB +%hook TUIEmojiSearchView +- (void)didMoveToWindow { + %orig; + self.backgroundColor = [UIColor blackColor]; +} +%end %hook UIPredictionViewController - (void)loadView { %orig;