From badff8b1b95e919ec8dd26cb98ef79bc491a5e9b Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Mon, 26 Feb 2024 00:48:47 -0600 Subject: [PATCH] =?UTF-8?q?added=20=E2=80=9CHide=20Fullscreen=20Button?= =?UTF-8?q?=E2=80=9D=20Option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #393 --- Sources/uYouPlus.xm | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/Sources/uYouPlus.xm b/Sources/uYouPlus.xm index 0c05c24..1998fa5 100644 --- a/Sources/uYouPlus.xm +++ b/Sources/uYouPlus.xm @@ -571,7 +571,7 @@ static NSString *accessGroupID() { %end // Video Controls Overlay Options -// Hide CC / Autoplay switch / Enable Share Button / Enable Save to Playlist Button / Hide YTMusic Button +// Hide CC / Hide Autoplay switch / Hide YTMusic Button / Enable Share Button / Enable Save to Playlist Button %hook YTMainAppControlsOverlayView - (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC button return IS_ENABLED(@"hideCC_enabled") ? %orig(NO) : %orig; @@ -580,6 +580,12 @@ static NSString *accessGroupID() { if (IS_ENABLED(@"hideAutoplaySwitch_enabled")) {} else { return %orig; } } +- (void)setYoutubeMusicButton:(id)arg1 { + if (IS_ENABLED(@"hideYTMusicButton_enabled")) { + } else { + %orig(arg1); + } +} - (void)setShareButtonAvailable:(BOOL)arg1 { if (IS_ENABLED(@"enableShareButton_enabled")) { %orig(YES); @@ -594,11 +600,20 @@ static NSString *accessGroupID() { %orig(NO); } } -- (void)setYoutubeMusicButton:(id)arg1 { - if (IS_ENABLED(@"hideYTMusicButton_enabled")) { - // Do not set - } else { - %orig(arg1); +%end + +// Hide Fullscreen Button +%hook YTInlinePlayerBarContainerView +- (void)layoutSubviews { + %orig; + if (IS_ENABLED(@"disableFullscreenButton_enabled")) { + if (self.exitFullscreenButton) { + [self.exitFullscreenButton removeFromSuperview]; + } + if (self.enterFullscreenButton) { + [self.enterFullscreenButton removeFromSuperview]; + } + self.fullscreenButtonDisabled = YES; } } %end