added “Hide Fullscreen Button” Option

Closes #393
This commit is contained in:
arichornlover 2024-02-26 00:48:47 -06:00 committed by GitHub
parent f61e4287b3
commit badff8b1b9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -571,7 +571,7 @@ static NSString *accessGroupID() {
%end %end
// Video Controls Overlay Options // 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 %hook YTMainAppControlsOverlayView
- (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC button - (void)setClosedCaptionsOrSubtitlesButtonAvailable:(BOOL)arg1 { // hide CC button
return IS_ENABLED(@"hideCC_enabled") ? %orig(NO) : %orig; return IS_ENABLED(@"hideCC_enabled") ? %orig(NO) : %orig;
@ -580,6 +580,12 @@ static NSString *accessGroupID() {
if (IS_ENABLED(@"hideAutoplaySwitch_enabled")) {} if (IS_ENABLED(@"hideAutoplaySwitch_enabled")) {}
else { return %orig; } else { return %orig; }
} }
- (void)setYoutubeMusicButton:(id)arg1 {
if (IS_ENABLED(@"hideYTMusicButton_enabled")) {
} else {
%orig(arg1);
}
}
- (void)setShareButtonAvailable:(BOOL)arg1 { - (void)setShareButtonAvailable:(BOOL)arg1 {
if (IS_ENABLED(@"enableShareButton_enabled")) { if (IS_ENABLED(@"enableShareButton_enabled")) {
%orig(YES); %orig(YES);
@ -594,11 +600,20 @@ static NSString *accessGroupID() {
%orig(NO); %orig(NO);
} }
} }
- (void)setYoutubeMusicButton:(id)arg1 { %end
if (IS_ENABLED(@"hideYTMusicButton_enabled")) {
// Do not set // Hide Fullscreen Button
} else { %hook YTInlinePlayerBarContainerView
%orig(arg1); - (void)layoutSubviews {
%orig;
if (IS_ENABLED(@"disableFullscreenButton_enabled")) {
if (self.exitFullscreenButton) {
[self.exitFullscreenButton removeFromSuperview];
}
if (self.enterFullscreenButton) {
[self.enterFullscreenButton removeFromSuperview];
}
self.fullscreenButtonDisabled = YES;
} }
} }
%end %end