From 6a5fd21a49ba3cd201672331cdfdd1fc4060587d Mon Sep 17 00:00:00 2001 From: arichorn <78001398+arichorn@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:25:55 -0500 Subject: [PATCH] Update Themes.xm --- Source/Themes.xm | 46 ++-------------------------------------------- 1 file changed, 2 insertions(+), 44 deletions(-) diff --git a/Source/Themes.xm b/Source/Themes.xm index de336c1..8543a33 100644 --- a/Source/Themes.xm +++ b/Source/Themes.xm @@ -78,22 +78,6 @@ UIColor *customColor = [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha: } %end %hook YTAsyncCollectionView -- (void)setBackgroundColor:(UIColor *)color { - if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTRelatedVideosCollectionViewController")]) { - color = [UIColor clearColor]; - } else if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTFullscreenMetadataHighlightsCollectionViewController")]) { - color = [UIColor clearColor]; - } else { - return isDarkMode() ? %orig(customColor) : %orig; - } - %orig; -} -- (UIColor *)darkBackgroundColor { - return isDarkMode() ? customColor : %orig; -} -- (void)setDarkBackgroundColor:(UIColor *)color { - return isDarkMode() ? %orig(customColor) : %orig; -} - (void)layoutSubviews { %orig(); if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTWatchNextResultsViewController")]) { @@ -377,7 +361,7 @@ UIColor *customColor = [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha: if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = customColor; } if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; } if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = customColor; } - if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.backgroundColor = customColor; } + if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.superview.backgroundColor = customColor; } if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = customColor; } if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = customColor; } if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = customColor; } @@ -386,11 +370,6 @@ UIColor *customColor = [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha: } } %end -%hook YTCinematicContainerView -- (void)setHidden:(BOOL)arg1 { - %orig(YES); -} -%end %end // OLED dark mode by @BandarHL and modified by @arichorn @@ -457,22 +436,6 @@ UIColor* raisedColor = [UIColor blackColor]; } %end %hook YTAsyncCollectionView -- (void)setBackgroundColor:(UIColor *)color { - if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTRelatedVideosCollectionViewController")]) { - color = [UIColor clearColor]; - } else if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTFullscreenMetadataHighlightsCollectionViewController")]) { - color = [UIColor clearColor]; - } else { - return isDarkMode() ? %orig([UIColor blackColor]) : %orig; - } - %orig; -} -- (UIColor *)darkBackgroundColor { - return isDarkMode() ? [UIColor blackColor] : %orig; -} -- (void)setDarkBackgroundColor:(UIColor *)color { - return isDarkMode() ? %orig([UIColor blackColor]) : %orig; -} - (void)layoutSubviews { %orig(); if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTWatchNextResultsViewController")]) { @@ -756,7 +719,7 @@ UIColor* raisedColor = [UIColor blackColor]; if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { 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.filter_chip_bar"]) { self.superview.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.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = [UIColor blackColor]; } @@ -765,11 +728,6 @@ UIColor* raisedColor = [UIColor blackColor]; } } %end -%hook YTCinematicContainerView -- (void)setHidden:(BOOL)arg1 { - %orig(YES); -} -%end %end // OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e