From f855e63f8e94308bbd07d34ac7bca8edb5ce335f Mon Sep 17 00:00:00 2001 From: arichornlover <78001398+arichornlover@users.noreply.github.com> Date: Fri, 26 Apr 2024 22:16:30 -0500 Subject: [PATCH] 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. --- Sources/ColourOptionsController.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Sources/ColourOptionsController.m b/Sources/ColourOptionsController.m index 261aae8..ca7b695 100644 --- a/Sources/ColourOptionsController.m +++ b/Sources/ColourOptionsController.m @@ -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