Added Landscape Support (ColourOptionsController.m)

Landscape Mode Support for iPad Pro 12.9 devices.

this should look better when in Landscape Mode now. the size it originally had was the same exact size from Portrait Mode. which made this harder to use in some areas when used in Landscape. Hopefully this is solved.
This commit is contained in:
arichornlover 2024-04-26 22:16:30 -05:00 committed by GitHub
parent 30569fee6b
commit f855e63f8e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -9,7 +9,7 @@
- (void)loadView {
[super loadView];
self.title = @"Theme Custom Color";
self.title = @"Custom Theme Color";
UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close" style:UIBarButtonItemStylePlain target:self action:@selector(close)];
UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithTitle:@"Save" style:UIBarButtonItemStylePlain target:self action:@selector(save)];
@ -24,10 +24,19 @@
[unarchiver setRequiresSecureCoding:NO];
UIColor *color = [unarchiver decodeObjectForKey:NSKeyedArchiveRootObjectKey];
self.selectedColor = color;
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPad && UIInterfaceOrientationIsLandscape(self.interfaceOrientation)) {
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGFloat screenWidth = screenRect.size.width;
if (screenWidth > 1024) {
self.view.transform = CGAffineTransformMakeScale(0.7, 0.7);
}
}
}
- (void)traitCollectionDidChange:(UITraitCollection *)previousTraitCollection {
[super traitCollectionDidChange:previousTraitCollection];
[self loadView];
}
@end