From 89c584e4c48bc97c3d5c8e4d8a16c42404ec5636 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 8 Aug 2016 15:49:17 -0500 Subject: [PATCH] Fixes minor GameViewController.sustainButtonsContentView layout issues MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Optimizes layout for 4” screens • Now appears beneath controller skin in landscape (as it should) --- Delta/Emulation/GameViewController.swift | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Delta/Emulation/GameViewController.swift b/Delta/Emulation/GameViewController.swift index 464602c..915c87b 100644 --- a/Delta/Emulation/GameViewController.swift +++ b/Delta/Emulation/GameViewController.swift @@ -139,7 +139,7 @@ extension GameViewController self.sustainButtonsContentView = UIView(frame: CGRect(x: 0, y: 0, width: self.gameView.bounds.width, height: self.gameView.bounds.height)) self.sustainButtonsContentView.translatesAutoresizingMaskIntoConstraints = false self.sustainButtonsContentView.isHidden = true - self.view.addSubview(self.sustainButtonsContentView) + self.view.insertSubview(self.sustainButtonsContentView, aboveSubview: self.gameView) let blurEffect = UIBlurEffect(style: .dark) let vibrancyEffect = UIVibrancyEffect(blurEffect: blurEffect) @@ -157,6 +157,9 @@ extension GameViewController self.sustainButtonsBackgroundView = RSTBackgroundView(frame: CGRect(x: 0, y: 0, width: vibrancyView.contentView.bounds.width, height: vibrancyView.contentView.bounds.height)) self.sustainButtonsBackgroundView.autoresizingMask = [.flexibleWidth, .flexibleHeight] self.sustainButtonsBackgroundView.textLabel.text = NSLocalizedString("Select Buttons to Sustain", comment: "") + self.sustainButtonsBackgroundView.textLabel.numberOfLines = 1 + self.sustainButtonsBackgroundView.textLabel.minimumScaleFactor = 0.5 + self.sustainButtonsBackgroundView.textLabel.adjustsFontSizeToFitWidth = true self.sustainButtonsBackgroundView.detailTextLabel.text = NSLocalizedString("Press the Menu button when finished.", comment: "") self.sustainButtonsBackgroundView.alpha = 0.0 vibrancyView.contentView.addSubview(self.sustainButtonsBackgroundView)