@@ -13,11 +13,6 @@ class LoginPrologueViewController: LoginViewController {
1313 var showCancel = false
1414
1515 @IBOutlet private weak var buttonContainerView : UIView !
16- /// Blur effect on button container view
17- ///
18- private var blurEffect : UIBlurEffect . Style {
19- return . systemChromeMaterial
20- }
2116
2217 /// Constraints on the button view container.
2318 /// Used to adjust the button width in unified views.
@@ -66,12 +61,10 @@ class LoginPrologueViewController: LoginViewController {
6661 topContainerView. pinSubviewToAllEdges ( topContainerChildViewController. view)
6762 }
6863
64+ setupViewBackground ( )
6965 createButtonViewController ( )
7066
7167 defaultButtonViewMargin = buttonViewLeadingConstraint? . constant ?? 0
72- if let backgroundImage = WordPressAuthenticator . shared. unifiedStyle? . prologueBackgroundImage {
73- view. layer. contents = backgroundImage. cgImage
74- }
7568 }
7669
7770 override func styleBackground( ) {
@@ -266,6 +259,7 @@ class LoginPrologueViewController: LoginViewController {
266259
267260 let primaryButtonStyle = WordPressAuthenticator . shared. style. prologuePrimaryButtonStyle
268261 let secondaryButtonStyle = WordPressAuthenticator . shared. style. prologueSecondaryButtonStyle
262+ let tertiaryButtonStyle = WordPressAuthenticator . shared. style. prologueTertiaryButtonStyle ?? NUXButtonStyle . linkButtonStyle
269263
270264 setButtonViewMargins ( forWidth: view. frame. width)
271265 let displayStrings = WordPressAuthenticator . shared. displayStrings
@@ -324,7 +318,7 @@ class LoginPrologueViewController: LoginViewController {
324318 isPrimary: false ,
325319 configureBodyFontForTitle: true ,
326320 accessibilityIdentifier: " Prologue Site Creation Guide button " ,
327- style: NUXButtonStyle . linkButtonStyle ,
321+ style: tertiaryButtonStyle ,
328322 onTap: siteCreationGuideCallback ( ) )
329323 } ( )
330324
@@ -386,26 +380,27 @@ class LoginPrologueViewController: LoginViewController {
386380 }
387381 }
388382
383+ private func setupViewBackground( ) {
384+ if let prologueViewBackgroundColor = WordPressAuthenticator . shared. unifiedStyle? . prologueViewBackgroundColor {
385+ view. backgroundColor = prologueViewBackgroundColor
386+ }
387+
388+ if let backgroundImage = WordPressAuthenticator . shared. unifiedStyle? . prologueBackgroundImage {
389+ let backgroundImageView = UIImageView ( image: backgroundImage)
390+ backgroundImageView. contentMode = WordPressAuthenticator . shared. unifiedStyle? . prologueBackgroundScaleMode ?? . scaleAspectFill
391+ backgroundImageView. translatesAutoresizingMaskIntoConstraints = false
392+ view. insertSubview ( backgroundImageView, at: 0 )
393+ view. pinSubviewToAllEdges ( backgroundImageView)
394+ }
395+ }
396+
389397 private func setButtonViewControllerBackground( ) {
390398 // Fallback to setting the button background color to clear so the blur effect blurs the Prologue background color.
391399 let buttonsBackgroundColor = WordPressAuthenticator . shared. unifiedStyle? . prologueButtonsBackgroundColor ?? . clear
392400 buttonViewController? . backgroundColor = buttonsBackgroundColor
393401 buttonBackgroundView? . backgroundColor = buttonsBackgroundColor
394402 stackedButtonsViewController? . backgroundColor = buttonsBackgroundColor
395403
396- /// If host apps provide a background color for the prologue buttons:
397- /// 1. Hide the blur effect
398- /// 2. Set the background color of the view controller to prologueViewBackgroundColor
399- let prologueViewBackgroundColor = WordPressAuthenticator . shared. unifiedStyle? . prologueViewBackgroundColor ?? . clear
400-
401- guard prologueViewBackgroundColor. cgColor == buttonsBackgroundColor. cgColor else {
402- buttonBlurEffectView. effect = UIBlurEffect ( style: blurEffect)
403- return
404- }
405- // do not set background color if we've set a background image earlier
406- if WordPressAuthenticator . shared. unifiedStyle? . prologueBackgroundImage == nil {
407- view. backgroundColor = prologueViewBackgroundColor
408- }
409404 // if a blur effect for the buttons was passed, use it; otherwise hide the view.
410405 guard let blurEffect = WordPressAuthenticator . shared. unifiedStyle? . prologueButtonsBlurEffect else {
411406 buttonBlurEffectView. isHidden = true
0 commit comments