diff --git a/Simplenote/AuthViewController+Swift.swift b/Simplenote/AuthViewController+Swift.swift
index f75ca3f38..00d46c05c 100644
--- a/Simplenote/AuthViewController+Swift.swift
+++ b/Simplenote/AuthViewController+Swift.swift
@@ -20,16 +20,23 @@ extension AuthViewController {
// Secondary Action
secondaryActionButton.contentTintColor = .simplenoteBrandColor
- // Toggle Signup: Tip
- switchTipField.textColor = .simplenoteTertiaryTextColor
-
- // Toggle Signup: Action
- switchActionButton.contentTintColor = .simplenoteBrandColor
-
// WordPress SSO
- wordPressSSOButton.image = NSImage(named: .wordPressLogo)?.tinted(with: .simplenoteBrandColor)
wordPressSSOButton.title = Localization.dotcomSSOAction
- wordPressSSOButton.contentTintColor = .simplenoteTertiaryTextColor
+ wordPressSSOButton.contentTintColor = .white
+ wordPressSSOContainerView.wantsLayer = true
+ wordPressSSOContainerView.layer?.backgroundColor = NSColor.simplenoteWPBlue50Color.cgColor
+ wordPressSSOContainerView.layer?.cornerRadius = 5
+
+ setupActionsSeparatorView()
+ }
+
+ private func setupActionsSeparatorView() {
+ leadingSeparatorView.wantsLayer = true
+ leadingSeparatorView.layer?.backgroundColor = NSColor.lightGray.cgColor
+ trailingSeparatorView.wantsLayer = true
+ trailingSeparatorView.layer?.backgroundColor = NSColor.lightGray.cgColor
+
+ separatorLabel.textColor = .lightGray
}
}
@@ -67,8 +74,6 @@ extension AuthViewController {
func refreshButtonTitles() {
actionButton.title = mode.primaryActionText
secondaryActionButton.title = mode.secondaryActionText?.uppercased() ?? ""
- switchTipField.stringValue = mode.switchActionTip.uppercased()
- switchActionButton.title = mode.switchActionText.uppercased()
}
/// Makes sure unused components (in the current mode) are effectively disabled
@@ -102,7 +107,7 @@ extension AuthViewController {
secondaryActionButton.alphaValue = mode.secondaryActionFieldAlpha
wordPressSSOButton.alphaValue = mode.wordPressSSOFieldAlpha
- switchAuthenticationView.isHidden = !mode.isSwitchVisible
+ actionsSeparatorView.isHidden = !mode.showActionSeparator
}
/// Animates Visible / Invisible components, based on the specified state
@@ -167,11 +172,6 @@ extension AuthViewController {
performSelector(onMainThread: secondaryActionSelector, with: nil, waitUntilDone: false)
}
- @IBAction
- func switchAuthenticationMode(_ sender: Any) {
- containingNavigationController?.push(nextViewController())
- }
-
private func nextViewController() -> AuthViewController {
let nextMode = mode.nextMode()
@@ -181,6 +181,11 @@ extension AuthViewController {
return nextVC
}
+
+ @objc
+ func pushEmailLoginView() {
+ containingNavigationController?.push(nextViewController())
+ }
}
diff --git a/Simplenote/AuthViewController.h b/Simplenote/AuthViewController.h
index 5d85ff413..6bb688721 100644
--- a/Simplenote/AuthViewController.h
+++ b/Simplenote/AuthViewController.h
@@ -17,11 +17,12 @@
@property (nonatomic, strong) IBOutlet NSButton *actionButton;
@property (nonatomic, strong) IBOutlet NSProgressIndicator *actionProgress;
@property (nonatomic, strong) IBOutlet NSButton *secondaryActionButton;
-@property (nonatomic, strong) IBOutlet NSTextField *switchTipField;
-@property (nonatomic, strong) IBOutlet NSButton *switchActionButton;
@property (nonatomic, strong) IBOutlet NSView *wordPressSSOContainerView;
@property (nonatomic, strong) IBOutlet NSButton *wordPressSSOButton;
-@property (weak) IBOutlet NSView *switchAuthenticationView;
+@property (weak) IBOutlet NSView *actionsSeparatorView;
+@property (weak) IBOutlet NSView *leadingSeparatorView;
+@property (weak) IBOutlet NSTextField *separatorLabel;
+@property (weak) IBOutlet NSView *trailingSeparatorView;
@property (nonatomic, strong) IBOutlet NSLayoutConstraint *passwordFieldHeightConstraint;
@property (nonatomic, strong) IBOutlet NSLayoutConstraint *secondaryActionHeightConstraint;
diff --git a/Simplenote/AuthViewController.m b/Simplenote/AuthViewController.m
index f8fde38bd..acbc1eeed 100644
--- a/Simplenote/AuthViewController.m
+++ b/Simplenote/AuthViewController.m
@@ -81,7 +81,6 @@ - (void)setInterfaceEnabled:(BOOL)enabled {
[self.passwordField setEnabled:enabled];
[self.actionButton setEnabled:enabled];
[self.secondaryActionButton setEnabled:enabled];
- [self.switchActionButton setEnabled:enabled];
[self.wordPressSSOButton setEnabled:enabled];
}
diff --git a/Simplenote/AuthViewController.xib b/Simplenote/AuthViewController.xib
index d77d84527..6493dcb7f 100644
--- a/Simplenote/AuthViewController.xib
+++ b/Simplenote/AuthViewController.xib
@@ -10,16 +10,17 @@
+
+
+
-
-
-
+
@@ -30,13 +31,13 @@
-
+
-
+
-
+
@@ -44,7 +45,7 @@
-
+
@@ -55,13 +56,13 @@
-
+
-
+
@@ -70,7 +71,7 @@
-
+
-
-
+
+
-
-
+
+
-
-
+
-
-
+
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
-
+
-
+
@@ -184,12 +181,15 @@
+
+
+
@@ -224,6 +224,5 @@
-
diff --git a/Simplenote/AuthenticationMode.swift b/Simplenote/AuthenticationMode.swift
index 0ae05869a..bc40aeeec 100644
--- a/Simplenote/AuthenticationMode.swift
+++ b/Simplenote/AuthenticationMode.swift
@@ -11,28 +11,33 @@ class AuthenticationMode: NSObject {
let secondaryActionText: String?
let secondaryActionSelector: Selector?
- let switchActionText: String
- let switchActionTip: String
let switchTargetMode: () -> AuthenticationMode
let isPasswordVisible: Bool
let isSecondaryActionVisible: Bool
let isWordPressVisible: Bool
- let isSwitchVisible: Bool
+ let showActionSeparator: Bool
- init(primaryActionText: String, primaryActionAnimationText: String, primaryActionSelector: Selector, secondaryActionText: String?, secondaryActionSelector: Selector?, switchActionText: String, switchActionTip: String, switchTargetMode: @escaping () -> AuthenticationMode, isPasswordVisible: Bool, isSecondaryActionVisible: Bool, isWordPressVisible: Bool, isSwitchVisible: Bool) {
+ init(primaryActionText: String,
+ primaryActionAnimationText: String,
+ primaryActionSelector: Selector,
+ secondaryActionText: String?,
+ secondaryActionSelector: Selector?,
+ switchTargetMode: @escaping () -> AuthenticationMode,
+ isPasswordVisible: Bool,
+ isSecondaryActionVisible: Bool,
+ isWordPressVisible: Bool,
+ showActionSeparator: Bool) {
self.primaryActionText = primaryActionText
self.primaryActionAnimationText = primaryActionAnimationText
self.primaryActionSelector = primaryActionSelector
self.secondaryActionText = secondaryActionText
self.secondaryActionSelector = secondaryActionSelector
- self.switchActionText = switchActionText
- self.switchActionTip = switchActionTip
self.switchTargetMode = switchTargetMode
self.isPasswordVisible = isPasswordVisible
self.isSecondaryActionVisible = isSecondaryActionVisible
self.isWordPressVisible = isWordPressVisible
- self.isSwitchVisible = isSwitchVisible
+ self.showActionSeparator = showActionSeparator
}
}
@@ -54,7 +59,7 @@ extension AuthenticationMode {
}
var wordPressSSOFieldHeight: CGFloat {
- isWordPressVisible ? CGFloat(72) : .zero
+ isWordPressVisible ? CGFloat(40) : .zero
}
var passwordFieldAlpha: CGFloat {
@@ -84,13 +89,11 @@ extension AuthenticationMode {
primaryActionSelector: #selector(AuthViewController.pressedLogInWithPassword),
secondaryActionText: LoginStrings.secondaryAction,
secondaryActionSelector: #selector(AuthViewController.openForgotPasswordURL),
- switchActionText: LoginStrings.switchAction,
- switchActionTip: LoginStrings.switchTip,
switchTargetMode: { .signup },
isPasswordVisible: true,
isSecondaryActionVisible: true,
isWordPressVisible: true,
- isSwitchVisible: false)
+ showActionSeparator: true)
}
/// Auth Mode: Login is handled via Magic Links!
@@ -102,13 +105,11 @@ extension AuthenticationMode {
primaryActionSelector: #selector(AuthViewController.pressedLoginWithMagicLink),
secondaryActionText: MagicLinkStrings.secondaryAction,
secondaryActionSelector: #selector(AuthViewController.switchToPasswordAuth),
- switchActionText: MagicLinkStrings.switchAction,
- switchActionTip: MagicLinkStrings.switchTip,
switchTargetMode: { .signup },
isPasswordVisible: false,
isSecondaryActionVisible: true,
isWordPressVisible: true,
- isSwitchVisible: false)
+ showActionSeparator: true)
}
/// Auth Mode: SignUp
@@ -118,15 +119,13 @@ extension AuthenticationMode {
AuthenticationMode(primaryActionText: SignupStrings.primaryAction,
primaryActionAnimationText: SignupStrings.primaryAnimationText,
primaryActionSelector: #selector(AuthViewController.pressedSignUp),
- secondaryActionText: nil,
- secondaryActionSelector: nil,
- switchActionText: SignupStrings.switchAction,
- switchActionTip: SignupStrings.switchTip,
+ secondaryActionText: SignupStrings.switchAction,
+ secondaryActionSelector: #selector(AuthViewController.pushEmailLoginView),
switchTargetMode: { .loginWithMagicLink },
isPasswordVisible: false,
- isSecondaryActionVisible: false,
+ isSecondaryActionVisible: true,
isWordPressVisible: false,
- isSwitchVisible: true)
+ showActionSeparator: false)
}
}
diff --git a/Simplenote/NSColor+Theme.swift b/Simplenote/NSColor+Theme.swift
index 611917ec1..b0e501987 100644
--- a/Simplenote/NSColor+Theme.swift
+++ b/Simplenote/NSColor+Theme.swift
@@ -237,6 +237,10 @@ extension NSColor {
static var simplenotePreferencesDividerColor: NSColor {
dynamicColor(lightStudio: .black, darkStudio: .white, lightColorAlpha: AppKitConstants.alpha0_1, darkColorAlpha: AppKitConstants.alpha0_1)
}
+
+ static var simplenoteWPBlue50Color: NSColor {
+ NSColor(studioColor: .wpBlue50)
+ }
}
// MARK: - Internal Colors