Readd hidden sidebar option and fix issue with portrait mode on compact iPhones

This commit is contained in:
Eilionoir Tunnicliff committed 2023-03-05 16:08:05 -05:00
1 parent e83b3a3bb3
commit 0f89fdc0e2
5 files changed
+20 -3

No files matched your search

+1 -1
View File
@@ -306,7 +306,7 @@
[self displayProgress:nil];
} else {
NSLog(@"[AltKit] Could not enable JIT compilation. %@", error);
[self displayProgress:[NSString stringWithFormat:localize(@"login.jit.fail.AltKit", nil), error]];
[self displayProgress:[NSString stringWithFormat:localize(@"login.jit.fail.AltKit", nil), error.description]];
[self displayProgress:nil];
showDialog(self, localize(@"Error", nil), error.description);
}
+1
View File
@@ -148,6 +148,7 @@ void loadPreferences(BOOL reset) {
setDefaultValueForPref(prefDict, @"check_sha", @YES);
setDefaultValueForPref(prefDict, @"auto_ram", @(!getEntitlementValue(@"com.apple.private.memorystatus")));
setDefaultValueForPref(prefDict, @"unsupported_warn_counter", @(0));
setDefaultValueForPref(prefDict, @"hidden_sidebar", @YES);
// Debug settings
setDefaultValueForPref(debugPrefDict, @"debug_skip_wait_jit", @NO);
@@ -120,6 +120,12 @@ typedef void(^CreateView)(UITableViewCell *, NSString *, NSDictionary *);
localize(@"preference.title.appicon-dark", nil)
]
},
@{@"key": @"hidden_sidebar",
@"hasDetail": @YES,
@"icon": @"sidebar.leading",
@"type": self.typeSwitch,
@"enableCondition": whenNotInGame
},
@{@"key": @"reset_warnings",
@"icon": @"exclamationmark.triangle",
@"type": self.typeButton,
+12 -2
View File
@@ -27,6 +27,8 @@ extern NSMutableDictionary *prefDict;
self.viewControllers = @[masterVc, detailVc];
[self changeDisplayModeForSize:self.view.frame.size];
self.maximumPrimaryColumnWidth = self.view.bounds.size.width * 0.95;
}
- (void)splitViewController:(UISplitViewController *)svc willChangeToDisplayMode:(UISplitViewControllerDisplayMode)displayMode {
@@ -46,10 +48,18 @@ extern NSMutableDictionary *prefDict;
- (void)changeDisplayModeForSize:(CGSize)size {
BOOL isPortrait = size.height > size.width;
if (self.preferredDisplayMode == 0 || self.displayMode != UISplitViewControllerDisplayModeSecondaryOnly) {
self.preferredDisplayMode = UISplitViewControllerDisplayModeSecondaryOnly;
if([getPreference(@"hidden_sidebar") boolValue] == NO) {
self.preferredDisplayMode = isPortrait ?
UISplitViewControllerDisplayModeOneOverSecondary :
UISplitViewControllerDisplayModeOneBesideSecondary;
} else {
self.preferredDisplayMode = UISplitViewControllerDisplayModeSecondaryOnly;
}
}
if (@available(iOS 14.0, tvOS 14.0, *)) {
self.preferredSplitBehavior = UISplitViewControllerSplitBehaviorOverlay;
self.preferredSplitBehavior = isPortrait ?
UISplitViewControllerSplitBehaviorOverlay :
UISplitViewControllerSplitBehaviorTile;
}
}
Binary file not shown.