mirror of
https://github.com/arichornlover/uYouEnhanced.git
synced 2026-04-21 03:32:08 +00:00
clean up
This commit is contained in:
parent
4930b0487d
commit
0ddc9b3a70
1 changed files with 49 additions and 99 deletions
148
uYouPlus.xm
148
uYouPlus.xm
|
|
@ -862,9 +862,8 @@ void DEMC_centerRenderingView() {
|
||||||
|
|
||||||
// Disable Pinch to zoom
|
// Disable Pinch to zoom
|
||||||
%hook YTColdConfig
|
%hook YTColdConfig
|
||||||
- (BOOL)videoZoomFreeZoomEnabledGlobalConfig {
|
- (BOOL)videoZoomFreeZoomEnabledGlobalConfig {
|
||||||
if (IsEnabled(@"pinchToZoom_enabled")) { return NO; }
|
return IsEnabled(@"pinchToZoom_enabled") ? NO : %orig;
|
||||||
else { return %orig; }
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
|
@ -872,10 +871,7 @@ void DEMC_centerRenderingView() {
|
||||||
// Hide CC / Autoplay switch
|
// Hide CC / Autoplay switch
|
||||||
%hook YTMainAppControlsOverlayView
|
%hook YTMainAppControlsOverlayView
|
||||||
- (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC button
|
- (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC button
|
||||||
if (IsEnabled(@"hideCC_enabled")) {
|
return IsEnabled(@"hideCC_enabled") ? %orig(NO) : %orig;
|
||||||
return %orig(NO);
|
|
||||||
}
|
|
||||||
else { return %orig; }
|
|
||||||
}
|
}
|
||||||
- (void)setAutoplaySwitchButtonRenderer:(id)arg1 { // hide Autoplay
|
- (void)setAutoplaySwitchButtonRenderer:(id)arg1 { // hide Autoplay
|
||||||
if (IsEnabled(@"hideAutoplaySwitch_enabled")) {}
|
if (IsEnabled(@"hideAutoplaySwitch_enabled")) {}
|
||||||
|
|
@ -916,17 +912,15 @@ void DEMC_centerRenderingView() {
|
||||||
|
|
||||||
// Bring back the red progress bar
|
// Bring back the red progress bar
|
||||||
%hook YTColdConfig
|
%hook YTColdConfig
|
||||||
- (BOOL)segmentablePlayerBarUpdateColors {
|
- (BOOL)segmentablePlayerBarUpdateColors {
|
||||||
if (IsEnabled(@"redProgressBar_enabled")) { return NO; }
|
return IsEnabled(@"redProgressBar_enabled") ? NO : %orig;
|
||||||
else { return %orig; }
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Disable the right panel in fullscreen mode
|
// Disable the right panel in fullscreen mode
|
||||||
%hook YTColdConfig
|
%hook YTColdConfig
|
||||||
- (BOOL)isLandscapeEngagementPanelEnabled {
|
- (BOOL)isLandscapeEngagementPanelEnabled {
|
||||||
if (IsEnabled(@"hideRightPanel_enabled")) { return NO; }
|
return IsEnabled(@"hideRightPanel_enabled") ? NO : %orig;
|
||||||
else { return %orig; }
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
|
@ -1012,58 +1006,40 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
||||||
%group gOLED
|
%group gOLED
|
||||||
%hook YTCommonColorPalette
|
%hook YTCommonColorPalette
|
||||||
- (UIColor *)brandBackgroundSolid {
|
- (UIColor *)brandBackgroundSolid {
|
||||||
if (self.pageStyle == 1) {
|
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||||
return [UIColor blackColor];
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
- (UIColor *)brandBackgroundPrimary {
|
- (UIColor *)brandBackgroundPrimary {
|
||||||
if (self.pageStyle == 1) {
|
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||||
return [UIColor blackColor];
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
- (UIColor *)brandBackgroundSecondary {
|
- (UIColor *)brandBackgroundSecondary {
|
||||||
if (self.pageStyle == 1) {
|
return self.pageStyle == 1 ? [[UIColor blackColor] colorWithAlphaComponent:0.9] : %orig;
|
||||||
return [[UIColor blackColor] colorWithAlphaComponent:0.9];
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
- (UIColor *)raisedBackground {
|
- (UIColor *)raisedBackground {
|
||||||
if (self.pageStyle == 1) {
|
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||||
return [UIColor blackColor];
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
- (UIColor *)staticBrandBlack {
|
- (UIColor *)staticBrandBlack {
|
||||||
if (self.pageStyle == 1) {
|
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||||
return [UIColor blackColor];
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
- (UIColor *)generalBackgroundA {
|
- (UIColor *)generalBackgroundA {
|
||||||
if (self.pageStyle == 1) {
|
return self.pageStyle == 1 ? [UIColor blackColor] : %orig;
|
||||||
return [UIColor blackColor];
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Account view controller
|
// Account view controller
|
||||||
%hook YTAccountPanelBodyViewController
|
// %hook YTAccountPanelBodyViewController
|
||||||
- (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
// - (UIColor *)backgroundColor:(NSInteger)pageStyle {
|
||||||
if (pageStyle == 1) {
|
// if (pageStyle == 1) {
|
||||||
return [UIColor blackColor];
|
// return [UIColor greenColor];
|
||||||
}
|
// }
|
||||||
return %orig;
|
// return %orig;
|
||||||
}
|
// }
|
||||||
%end
|
// %end
|
||||||
|
|
||||||
// Explore
|
// Explore
|
||||||
%hook ASScrollView
|
%hook ASScrollView
|
||||||
- (void)didMoveToWindow {
|
- (void)didMoveToWindow {
|
||||||
%orig;
|
%orig;
|
||||||
if (isDarkMode()) {
|
if (isDarkMode()) {
|
||||||
self.backgroundColor = [UIColor clearColor];
|
self.backgroundColor = [UIColor clearColor];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1073,7 +1049,7 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
||||||
%hook ASCollectionView
|
%hook ASCollectionView
|
||||||
- (void)didMoveToWindow {
|
- (void)didMoveToWindow {
|
||||||
%orig;
|
%orig;
|
||||||
if (isDarkMode() && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
|
if (isDarkMode() && [self.nextResponder isKindOfClass:%c(_ASDisplayView)]) {
|
||||||
self.superview.backgroundColor = [UIColor blackColor];
|
self.superview.backgroundColor = [UIColor blackColor];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1110,55 +1086,38 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
||||||
|
|
||||||
// Search View
|
// Search View
|
||||||
%hook YTSearchBarView
|
%hook YTSearchBarView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||||
return %orig([UIColor blackColor]);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// History Search view
|
// History Search view
|
||||||
%hook YTSearchBoxView
|
%hook YTSearchBoxView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||||
return %orig([UIColor blackColor]);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Comment view
|
// Comment view
|
||||||
%hook YTCommentView
|
%hook YTCommentView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||||
return %orig([UIColor blackColor]);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%hook YTCreateCommentAccessoryView
|
%hook YTCreateCommentAccessoryView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||||
return %orig([UIColor blackColor]);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%hook YTCreateCommentTextView
|
%hook YTCreateCommentTextView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||||
return %orig([UIColor blackColor]);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
|
- (void)setTextColor:(UIColor *)color { // fix black text in #Shorts video's comment
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig([UIColor whiteColor]) : %orig;
|
||||||
return %orig([UIColor whiteColor]);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
|
@ -1173,39 +1132,36 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
||||||
|
|
||||||
%hook YTFormattedStringLabel // YT is werid...
|
%hook YTFormattedStringLabel // YT is werid...
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig([UIColor clearColor]) : %orig;
|
||||||
return %orig([UIColor clearColor]);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
// Live chat comment
|
// Live chat comment
|
||||||
%hook YCHLiveChatActionPanelView
|
%hook YCHLiveChatActionPanelView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||||
return %orig([UIColor blackColor]);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%hook YTEmojiTextView
|
%hook YTEmojiTextView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
|
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||||
|
}
|
||||||
|
%end
|
||||||
|
|
||||||
|
%hook YCHLiveChatView
|
||||||
|
- (void)didMoveToWindow {
|
||||||
|
%orig;
|
||||||
if (isDarkMode()) {
|
if (isDarkMode()) {
|
||||||
return %orig([UIColor blackColor]);
|
self.subviews[1].backgroundColor = [UIColor blackColor];
|
||||||
}
|
}
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
//
|
//
|
||||||
%hook YTBackstageCreateRepostDetailView
|
%hook YTBackstageCreateRepostDetailView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig([UIColor blackColor]) : %orig;
|
||||||
return %orig([UIColor blackColor]);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
|
|
@ -1231,26 +1187,20 @@ UIColor* raisedColor = [UIColor colorWithRed:0.035 green:0.035 blue:0.035 alpha:
|
||||||
// Open link with...
|
// Open link with...
|
||||||
%hook ASWAppSwitchingSheetHeaderView
|
%hook ASWAppSwitchingSheetHeaderView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig(raisedColor) : %orig;
|
||||||
return %orig(raisedColor);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%hook ASWAppSwitchingSheetFooterView
|
%hook ASWAppSwitchingSheetFooterView
|
||||||
- (void)setBackgroundColor:(UIColor *)color {
|
- (void)setBackgroundColor:(UIColor *)color {
|
||||||
if (isDarkMode()) {
|
return isDarkMode() ? %orig(raisedColor) : %orig;
|
||||||
return %orig(raisedColor);
|
|
||||||
}
|
|
||||||
return %orig;
|
|
||||||
}
|
}
|
||||||
%end
|
%end
|
||||||
|
|
||||||
%hook ASWAppSwitcherCollectionViewCell
|
%hook ASWAppSwitcherCollectionViewCell
|
||||||
- (void)didMoveToWindow {
|
- (void)didMoveToWindow {
|
||||||
%orig;
|
%orig;
|
||||||
if (isDarkMode()) {
|
if (isDarkMode()) {
|
||||||
self.backgroundColor = raisedColor;
|
self.backgroundColor = raisedColor;
|
||||||
self.subviews[1].backgroundColor = raisedColor;
|
self.subviews[1].backgroundColor = raisedColor;
|
||||||
self.superview.backgroundColor = raisedColor;
|
self.superview.backgroundColor = raisedColor;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue