mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-03-11 21:26:04 +00:00
Improved Old Dark Mode
This commit is contained in:
parent
00e43bcce2
commit
6667de67fe
1 changed files with 60 additions and 46 deletions
106
Source/Themes.xm
106
Source/Themes.xm
|
|
@ -13,37 +13,70 @@ static BOOL oldDarkTheme() {
|
|||
return ([[NSUserDefaults standardUserDefaults] integerForKey:@"appTheme"] == 2);
|
||||
}
|
||||
|
||||
YTUserDefaults *ytThemeSettings;
|
||||
|
||||
%hook YTUserDefaults
|
||||
- (long long)appThemeSetting {
|
||||
ytThemeSettings = self;
|
||||
return %orig;
|
||||
}
|
||||
%end
|
||||
|
||||
// Themes.xm - Theme Options
|
||||
// Old dark theme (gray)
|
||||
%group gOldDarkTheme
|
||||
UIColor *customColor = [UIColor colorWithRed:0.129 green:0.129 blue:0.129 alpha:1.0];
|
||||
%hook YTCommonColorPalette
|
||||
- (UIColor *)brandBackgroundSolid {
|
||||
return self.pageStyle == 1 ? customColor : %orig;
|
||||
}
|
||||
- (UIColor *)brandBackgroundPrimary {
|
||||
return self.pageStyle == 1 ? customColor : %orig;
|
||||
}
|
||||
- (UIColor *)brandBackgroundSecondary {
|
||||
return self.pageStyle == 1 ? [customColor colorWithAlphaComponent:0.9] : %orig;
|
||||
}
|
||||
- (UIColor *)raisedBackground {
|
||||
return self.pageStyle == 1 ? customColor : %orig;
|
||||
}
|
||||
- (UIColor *)staticBrandBlack {
|
||||
return self.pageStyle == 1 ? customColor : %orig;
|
||||
}
|
||||
- (UIColor *)generalBackgroundA {
|
||||
return self.pageStyle == 1 ? customColor : %orig;
|
||||
%hook UIView
|
||||
- (void)setBackgroundColor:(UIColor *)color {
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTPivotBarView")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTSlideForActionsView")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTChipCloudCell")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTEngagementPanelView")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTPlaylistPanelProminentThumbnailVideoCell")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTPlaylistHeaderView")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTAsyncCollectionView")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTLinkCell")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTMessageCell")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTSearchView")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTDrawerAvatarCell")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTFeedHeaderView")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YCHLiveChatTextCell")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YCHLiveChatViewerEngagementCell")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTCommentsHeaderView")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YCHLiveChatView")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YCHLiveChatTickerViewController")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTInnerTubeCollectionViewController")]) {
|
||||
color = customColor;
|
||||
}
|
||||
if ([self.nextResponder isKindOfClass:NSClassFromString(@"YTEditSheetControllerHeader")]) {
|
||||
color = customColor;
|
||||
}
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
|
||||
|
|
@ -728,25 +761,6 @@ UIColor* raisedColor = [UIColor blackColor];
|
|||
- (void)updateColors {
|
||||
}
|
||||
%end
|
||||
%hook YTCreateCommentTextView
|
||||
- (void)setTextColor:(UIColor *)color {
|
||||
long long ytDarkModeCheck = [ytThemeSettings appThemeSetting];
|
||||
if (ytDarkModeCheck == 0 || ytDarkModeCheck == 1) {
|
||||
if (UIScreen.mainScreen.traitCollection.userInterfaceStyle == UIUserInterfaceStyleLight) {
|
||||
color = [UIColor blackColor];
|
||||
} else {
|
||||
color = [UIColor whiteColor];
|
||||
}
|
||||
}
|
||||
if (ytDarkModeCheck == 2) {
|
||||
color = [UIColor blackColor];
|
||||
}
|
||||
if (ytDarkModeCheck == 3) {
|
||||
color = [UIColor whiteColor];
|
||||
}
|
||||
%orig;
|
||||
}
|
||||
%end
|
||||
%hook YTShareMainView
|
||||
- (void)layoutSubviews {
|
||||
%orig();
|
||||
|
|
|
|||
Loading…
Reference in a new issue