Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Commit

Permalink
added an option to disable the home screen wallpaper zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexandra authored and Alexandra committed May 17, 2023
1 parent 4280940 commit 3a260f9
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Preferences/PreferenceKeys.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ static NSString* const kPreferenceKeyLockScreenVolume = @"LockScreenVolume";
static NSString* const kPreferenceKeyEnableHomeScreenWallpaper = @"EnableHomeScreenWallpaper";
static NSString* const kPreferenceKeyHomeScreenWallpaper = @"HomeScreenWallpaper";
static NSString* const kPreferenceKeyHomeScreenVolume = @"HomeScreenVolume";
static NSString* const kPreferenceKeyZoomWallpaper = @"ZoomWallpaper";
static NSString* const kPreferenceKeyMuteWhenMusicPlays = @"MuteWhenMusicPlays";
static NSString* const kPreferenceKeyDisableInLowPowerMode = @"DisableInLowPowerMode";

Expand All @@ -22,5 +23,6 @@ static BOOL const kPreferenceKeyEnableLockScreenWallpaperDefaultValue = NO;
static CGFloat const kPreferenceKeyLockScreenVolumeDefaultValue = 0;
static BOOL const kPreferenceKeyEnableHomeScreenWallpaperDefaultValue = NO;
static CGFloat const kPreferenceKeyHomeScreenVolumeDefaultValue = 0;
static BOOL const kPreferenceKeyZoomWallpaperDefaultValue = YES;
static BOOL const kPreferenceKeyMuteWhenMusicPlaysDefaultValue = YES;
static BOOL const kPreferenceKeyDisableInLowPowerModeDefaultValue = YES;
18 changes: 18 additions & 0 deletions Preferences/Resources/Root.plist
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@
<string>PSGroupCell</string>
<key>label</key>
<string>Home Screen</string>
<key>footerText</key>
<string>Disabling the wallpaper zoom will expose your original wallpaper in the app switcher.</string>
<key>isStaticText</key>
<true />
</dict>
<dict>
<key>cell</key>
Expand Down Expand Up @@ -168,6 +172,20 @@
<key>PostNotification</key>
<string>dev.traurige.eneko.preferences.reload</string>
</dict>
<dict>
<key>cell</key>
<string>PSSwitchCell</string>
<key>default</key>
<true />
<key>defaults</key>
<string>dev.traurige.eneko.preferences</string>
<key>key</key>
<string>ZoomWallpaper</string>
<key>label</key>
<string>Zoom Wallpaper</string>
<key>PostNotification</key>
<string>dev.traurige.eneko.preferences.reload</string>
</dict>

<dict>
<key>cell</key>
Expand Down
1 change: 1 addition & 0 deletions Tweak/Eneko.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ BOOL pfEnableLockScreenWallpaper;
CGFloat pfLockScreenVolume;
BOOL pfEnableHomeScreenWallpaper;
CGFloat pfHomeScreenVolume;
BOOL pfZoomWallpaper;
BOOL pfMuteWhenMusicPlays;
BOOL pfDisableInLowPowerMode;

Expand Down
10 changes: 8 additions & 2 deletions Tweak/Eneko.m
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ static void override_SBIconController_viewDidLoad(SBIconController* self, SEL _c
homeScreenPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:homeScreenPlayer];
[homeScreenPlayerLayer setVideoGravity:AVLayerVideoGravityResizeAspectFill];
[homeScreenPlayerLayer setFrame:[[[self view] layer] bounds]];
[homeScreenPlayerLayer setTransform:CATransform3DMakeScale(1.15, 1.15, 2)];

if (pfZoomWallpaper) {
[homeScreenPlayerLayer setTransform:CATransform3DMakeScale(1.15, 1.15, 2)];
}

[[[self view] layer] insertSublayer:homeScreenPlayerLayer atIndex:0];

[[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryAmbient error:nil];
Expand Down Expand Up @@ -468,15 +472,17 @@ static void load_preferences() {
kPreferenceKeyLockScreenVolume: @(kPreferenceKeyLockScreenVolumeDefaultValue),
kPreferenceKeyEnableHomeScreenWallpaper: @(kPreferenceKeyEnableHomeScreenWallpaperDefaultValue),
kPreferenceKeyHomeScreenVolume: @(kPreferenceKeyHomeScreenVolumeDefaultValue),
kPreferenceKeyZoomWallpaper: @(kPreferenceKeyZoomWallpaperDefaultValue),
kPreferenceKeyMuteWhenMusicPlays: @(kPreferenceKeyMuteWhenMusicPlaysDefaultValue),
kPreferenceKeyDisableInLowPowerMode: @(kPreferenceKeyDisableInLowPowerModeDefaultValue),
kPreferenceKeyDisableInLowPowerMode: @(kPreferenceKeyDisableInLowPowerModeDefaultValue)
}];

pfEnabled = [[preferences objectForKey:kPreferenceKeyEnabled] boolValue];
pfEnableLockScreenWallpaper = [[preferences objectForKey:kPreferenceKeyEnableLockScreenWallpaper] boolValue];
pfLockScreenVolume = [[preferences objectForKey:kPreferenceKeyLockScreenVolume] floatValue];
pfEnableHomeScreenWallpaper = [[preferences objectForKey:kPreferenceKeyEnableHomeScreenWallpaper] boolValue];
pfHomeScreenVolume = [[preferences objectForKey:kPreferenceKeyHomeScreenVolume] floatValue];
pfZoomWallpaper = [[preferences objectForKey:kPreferenceKeyZoomWallpaper] boolValue];
pfMuteWhenMusicPlays = [[preferences objectForKey:kPreferenceKeyMuteWhenMusicPlays] boolValue];
pfDisableInLowPowerMode = [[preferences objectForKey:kPreferenceKeyDisableInLowPowerMode] boolValue];
}
Expand Down
2 changes: 1 addition & 1 deletion control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: dev.traurige.eneko
Name: Eneko
Depends: firmware (>= 14.0), mobilesubstrate, preferenceloader, com.mrgcgamer.libgcuniversal
Conflicts: love.litten.eneko
Version: 1.3
Version: 1.4
Architecture: iphoneos-arm
Description: Live wallpapers for iOS
Maintainer: Traurige <[email protected]>
Expand Down

0 comments on commit 3a260f9

Please sign in to comment.