Updated Themes #266
This commit is contained in:
parent
0e22bef9cd
commit
8de5f0bb10
1 changed files with 62 additions and 344 deletions
406
Source/Themes.xm
406
Source/Themes.xm
|
|
@ -1,327 +1,54 @@
|
|||
#import "../uYouPlus.h"
|
||||
|
||||
static BOOL IsEnabled(NSString *key) {
|
||||
return [[NSUserDefaults standardUserDefaults] boolForKey:key];
|
||||
}
|
||||
static BOOL isDarkMode() {
|
||||
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1);
|
||||
}
|
||||
static BOOL oledDarkTheme() {
|
||||
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"appTheme"] == 1);
|
||||
}
|
||||
static BOOL oldDarkTheme() {
|
||||
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"appTheme"] == 2);
|
||||
}
|
||||
#define IS_DARK_APPEARANCE_ENABLED ([[NSUserDefaults standardUserDefaults] integerForKey:@"page_style"] == 1)
|
||||
#define IS_OLD_DARK_THEME_SELECTED (APP_THEME_IDX == 1)
|
||||
#define IS_OLED_DARK_THEME_SELECTED (APP_THEME_IDX == 2)
|
||||
|
||||
// Themes.xm - Theme Options
|
||||
// Fix navigation bar showing a lighter grey with default dark mode
|
||||
%hook YTCommonColorPalette
|
||||
- (UIColor *)brandBackgroundSolid {
|
||||
return self.pageStyle == 1 ? [UIColor colorWithRed:0.05882352941176471 green:0.05882352941176471 blue:0.05882352941176471 alpha:1.0] : %orig;
|
||||
}
|
||||
%end
|
||||
# pragma mark - Old dark theme (lighter grey)
|
||||
|
||||
// Old dark theme (gray)
|
||||
%group gOldDarkTheme
|
||||
UIColor *originalColor = [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0];
|
||||
%hook YTCommonColorPalette
|
||||
- (UIColor *)background1 {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
- (UIColor *)background2 {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
- (UIColor *)background3 {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
- (UIColor *)baseBackground {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
- (UIColor *)brandBackgroundSolid {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
- (UIColor *)brandBackgroundPrimary {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
- (UIColor *)brandBackgroundSecondary {
|
||||
return self.pageStyle == 1 ? [originalColor colorWithAlphaComponent:0.9] : %orig;
|
||||
}
|
||||
- (UIColor *)raisedBackground {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
- (UIColor *)staticBrandBlack {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
- (UIColor *)generalBackgroundA {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
- (UIColor *)generalBackgroundB {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
- (UIColor *)menuBackground {
|
||||
return self.pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
%hook YTColdConfig
|
||||
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
|
||||
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteTextColorForNative { return NO; }
|
||||
- (BOOL)enableCinematicContainerOnClient { return NO; }
|
||||
%end
|
||||
|
||||
%hook YTInnerTubeCollectionViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
return pageStyle == 1 ? originalColor : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Explore
|
||||
%hook ASScrollView
|
||||
%hook _ASDisplayView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
}
|
||||
%end
|
||||
|
||||
// Your videos
|
||||
%hook ASCollectionView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode() && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
|
||||
self.superview.backgroundColor = originalColor;
|
||||
}
|
||||
self.superview.backgroundColor = [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0];
|
||||
}
|
||||
%end
|
||||
|
||||
// Sub menu?
|
||||
%hook ELMView
|
||||
%hook YTFullscreenEngagementOverlayView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
%end
|
||||
|
||||
// iSponsorBlock
|
||||
%hook SponsorBlockSettingsController
|
||||
- (void)viewDidLoad {
|
||||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||
%orig;
|
||||
self.tableView.backgroundColor = originalColor;
|
||||
} else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
%hook SponsorBlockViewController
|
||||
- (void)viewDidLoad {
|
||||
if (self.traitCollection.userInterfaceStyle == UIUserInterfaceStyleDark) {
|
||||
%orig;
|
||||
self.view.backgroundColor = originalColor;
|
||||
} else { return %orig; }
|
||||
}
|
||||
%end
|
||||
|
||||
// Search View
|
||||
%hook YTSearchBarView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// History Search view
|
||||
%hook YTSearchBoxView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
|
||||
}
|
||||
%end
|
||||
|
||||
// Comment view
|
||||
%hook YTCommentView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCreateCommentAccessoryView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCreateCommentTextView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
|
||||
return isDarkMode() ? %orig([UIColor whiteColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCommentDetailHeaderCell
|
||||
%hook YTRelatedVideosView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[2].backgroundColor = originalColor;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTAsyncCollectionView
|
||||
- (void)layoutSubviews {
|
||||
%orig();
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTWatchNextResultsViewController")]) {
|
||||
if (isDarkMode()) {
|
||||
self.subviews[0].subviews[0].backgroundColor = originalColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTFormattedStringLabel // YT is werid...
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor clearColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Live chat comment
|
||||
%hook YCHLiveChatActionPanelView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YCHLiveChatView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[1].backgroundColor = originalColor;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTEmojiTextView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTAppView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCollectionView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTChannelListSubMenuView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTChannelSubMenuView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTWrapperSplitView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPageView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTWatchView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTPrivacyTosFooterView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
//
|
||||
%hook YTBackstageCreateRepostDetailView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(originalColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Others
|
||||
%hook _ASDisplayView
|
||||
- (void)layoutSubviews {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
UIResponder *responder = [self nextResponder];
|
||||
while (responder != nil) {
|
||||
if ([responder isKindOfClass:NSClassFromString(@"YTActionSheetDialogViewController")]) {
|
||||
self.backgroundColor = originalColor;
|
||||
}
|
||||
if ([responder isKindOfClass:NSClassFromString(@"YTPanelLoadingStrategyViewController")]) {
|
||||
self.backgroundColor = originalColor;
|
||||
}
|
||||
if ([responder isKindOfClass:NSClassFromString(@"YTTabHeaderElementsViewController")]) {
|
||||
self.backgroundColor = originalColor;
|
||||
}
|
||||
if ([responder isKindOfClass:NSClassFromString(@"YTEditSheetControllerElementsContentViewController")]) {
|
||||
self.backgroundColor = originalColor;
|
||||
}
|
||||
responder = [responder nextResponder];
|
||||
}
|
||||
}
|
||||
}
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"brand_promo.view"]) { self.superview.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"eml.cvr"]) { self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"eml.topic_channel_details"]) { self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"eml.live_chat_text_message"]) { self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"rich_header"]) { self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_cell"]) { self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.comment_thread"]) { self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.ui.cancel.button"]) { self.superview.backgroundColor = [UIColor clearColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.comment_composer"]) { self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.filter_chip_bar"]) { self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.elements.components.video_list_entry"]) { self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.guidelines_text"]) { self.superview.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.timed_comments_welcome"]) { self.superview.backgroundColor = self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_bottom_sheet_container"]) { self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.channel_guidelines_entry_banner_container"]) { self.superview.backgroundColor = self.backgroundColor = originalColor; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
}
|
||||
self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
%end
|
||||
%end
|
||||
|
||||
// OLED dark mode by @BandarHL
|
||||
UIColor* raisedColor = [UIColor blackColor];
|
||||
# pragma mark - OLED dark mode by BandarHL
|
||||
|
||||
UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:1.0];
|
||||
|
||||
%group gOLED
|
||||
%hook YTCommonColorPalette
|
||||
- (UIColor *)background1 {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)background2 {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)background3 {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)baseBackground {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
|
|
@ -343,16 +70,9 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
- (UIColor *)generalBackgroundA {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)generalBackgroundB {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
- (UIColor *)menuBackground {
|
||||
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
/*
|
||||
// uYou settings (Conflicts iSponsorBlock)
|
||||
// uYou settings
|
||||
%hook UITableViewCell
|
||||
- (void)_layoutSystemBackgroundView {
|
||||
%orig;
|
||||
|
|
@ -386,7 +106,6 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
self.tableView.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
%end
|
||||
*/
|
||||
|
||||
%hook YTInnerTubeCollectionViewController
|
||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||
|
|
@ -398,7 +117,7 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
%hook ASScrollView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
self.backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
}
|
||||
|
|
@ -408,7 +127,7 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
%hook ASCollectionView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode() && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
|
||||
if (IS_DARK_APPEARANCE_ENABLED && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
|
||||
self.superview.backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
|
|
@ -418,8 +137,8 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
%hook ELMView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
// self.subviews[0].backgroundColor = [UIColor clearColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
|
@ -443,17 +162,17 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
}
|
||||
%end
|
||||
|
||||
// Search View
|
||||
// Search view
|
||||
%hook YTSearchBarView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// History Search view
|
||||
// History search view
|
||||
%hook YTSearchBoxView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
|
||||
}
|
||||
%end
|
||||
|
|
@ -461,72 +180,72 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
// Comment view
|
||||
%hook YTCommentView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCreateCommentAccessoryView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCreateCommentTextView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
|
||||
return isDarkMode() ? %orig([UIColor whiteColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor whiteColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCommentDetailHeaderCell
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[2].backgroundColor = [UIColor blackColor];
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
// self.subviews[2].backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTFormattedStringLabel // YT is werid...
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor clearColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor clearColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Live chat comment
|
||||
%hook YCHLiveChatActionPanelView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTEmojiTextView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YCHLiveChatView
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
self.subviews[1].backgroundColor = [UIColor blackColor];
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
// self.subviews[1].backgroundColor = [UIColor blackColor];
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
%hook YTCollectionView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
//
|
||||
%hook YTBackstageCreateRepostDetailView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig([UIColor blackColor]) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -534,7 +253,7 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
%hook _ASDisplayView
|
||||
- (void)layoutSubviews {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
UIResponder *responder = [self nextResponder];
|
||||
while (responder != nil) {
|
||||
if ([responder isKindOfClass:NSClassFromString(@"YTActionSheetDialogViewController")]) {
|
||||
|
|
@ -555,23 +274,18 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
}
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
if ([self.nextResponder isKindOfClass:%c(ASScrollView)]) { 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.channel_guidelines_entry_banner_container"]) { self.backgroundColor = [UIColor blackColor]; }
|
||||
if ([self.accessibilityIdentifier isEqualToString:@"id.comment.comment_group_detail_container"]) { self.backgroundColor = [UIColor clearColor]; }
|
||||
}
|
||||
}
|
||||
|
|
@ -580,29 +294,35 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
// Open link with...
|
||||
%hook ASWAppSwitchingSheetHeaderView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(raisedColor) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig(raisedColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook ASWAppSwitchingSheetFooterView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
return isDarkMode() ? %orig(raisedColor) : %orig;
|
||||
return IS_DARK_APPEARANCE_ENABLED ? %orig(raisedColor) : %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
%hook ASWAppSwitcherCollectionViewCell
|
||||
- (void)didMoveToWindow {
|
||||
%orig;
|
||||
if (isDarkMode()) {
|
||||
if (IS_DARK_APPEARANCE_ENABLED) {
|
||||
self.backgroundColor = raisedColor;
|
||||
self.subviews[1].backgroundColor = raisedColor;
|
||||
// self.subviews[1].backgroundColor = raisedColor;
|
||||
self.superview.backgroundColor = raisedColor;
|
||||
}
|
||||
}
|
||||
%end
|
||||
|
||||
// Incompatibility with the new YT Dark theme
|
||||
%hook YTColdConfig
|
||||
- (BOOL)uiSystemsClientGlobalConfigUseDarkerPaletteBgColorForNative { return NO; }
|
||||
%end
|
||||
%end
|
||||
|
||||
// OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e
|
||||
# pragma mark - OLED keyboard by @ichitaso <3 - http://gist.github.com/ichitaso/935100fd53a26f18a9060f7195a1be0e
|
||||
|
||||
%group gOLEDKB
|
||||
%hook UIPredictionViewController
|
||||
- (void)loadView {
|
||||
|
|
@ -637,16 +357,14 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
%end
|
||||
%end
|
||||
|
||||
# pragma mark - ctor
|
||||
%ctor {
|
||||
%init;
|
||||
if (IsEnabled(@"oledKeyBoard_enabled")) {
|
||||
%init(gOLEDKB);
|
||||
}
|
||||
if (oledDarkTheme()) {
|
||||
if (IS_OLED_DARK_THEME_SELECTED) {
|
||||
%init(gOLED);
|
||||
}
|
||||
if (oldDarkTheme()) {
|
||||
%init(gOldDarkTheme);
|
||||
if (IS_OLD_DARK_THEME_SELECTED) {
|
||||
%init(gOldDarkTheme)
|
||||
}
|
||||
if (IS_ENABLED(@"oledKeyBoard_enabled")) {
|
||||
%init(gOLEDKB);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue