Skip to content

Commit

Permalink
Redesign wordpress sso button
Browse files Browse the repository at this point in the history
  • Loading branch information
charliescheer committed Jul 22, 2024
1 parent 6fa0e2c commit a670f8e
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
6 changes: 4 additions & 2 deletions Simplenote/AuthViewController+Swift.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ extension AuthViewController {
secondaryActionButton.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()
}
Expand Down
27 changes: 13 additions & 14 deletions Simplenote/AuthViewController.xib
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<view wantsLayer="YES" appearanceType="aqua" translatesAutoresizingMaskIntoConstraints="NO" id="kU7-kg-wG3" customClass="SPAuthenticationView">
<rect key="frame" x="0.0" y="0.0" width="380" height="568"/>
<rect key="frame" x="0.0" y="0.0" width="380" height="536"/>
<subviews>
<stackView distribution="fill" orientation="vertical" alignment="centerX" spacing="12" horizontalStackHuggingPriority="249.99998474121094" verticalStackHuggingPriority="249.99998474121094" detachesHiddenViews="YES" translatesAutoresizingMaskIntoConstraints="NO" id="PWa-EY-51O">
<rect key="frame" x="30" y="45" width="320" height="478"/>
<rect key="frame" x="30" y="45" width="320" height="446"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="W9h-HS-WbG">
<rect key="frame" x="112" y="382" width="96" height="96"/>
<rect key="frame" x="112" y="350" width="96" height="96"/>
<constraints>
<constraint firstAttribute="width" constant="96" id="Sys-NN-iWa"/>
<constraint firstAttribute="height" constant="96" id="mq9-yP-8Tc"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="icon_simplenote_login" id="2Fh-2C-hTH"/>
</imageView>
<textField focusRingType="none" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="lwM-mh-i3o">
<rect key="frame" x="-2" y="354" width="324" height="16"/>
<rect key="frame" x="-2" y="322" width="324" height="16"/>
<constraints>
<constraint firstAttribute="height" constant="16" id="Pcu-pb-Ma8"/>
</constraints>
Expand All @@ -56,13 +56,13 @@
</textFieldCell>
</textField>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Fco-3r-2Ys" userLabel="Username TextField" customClass="SPAuthenticationTextField">
<rect key="frame" x="0.0" y="302" width="320" height="40"/>
<rect key="frame" x="0.0" y="270" width="320" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="ZyF-TN-zXQ"/>
</constraints>
</customView>
<customView wantsLayer="YES" translatesAutoresizingMaskIntoConstraints="NO" id="2bk-bk-VfG" userLabel="Password TextField" customClass="SPAuthenticationTextField">
<rect key="frame" x="0.0" y="250" width="320" height="40"/>
<rect key="frame" x="0.0" y="218" width="320" height="40"/>
<constraints>
<constraint firstAttribute="height" constant="40" id="Cah-V8-aCS"/>
</constraints>
Expand All @@ -71,7 +71,7 @@
</userDefinedRuntimeAttributes>
</customView>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="Epn-oY-sfo" userLabel="Action View">
<rect key="frame" x="0.0" y="172" width="320" height="66"/>
<rect key="frame" x="0.0" y="140" width="320" height="66"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="Lid-6Q-zHR" userLabel="Main Action Button" customClass="SPAuthenticationButton">
<rect key="frame" x="0.0" y="0.0" width="320" height="40"/>
Expand Down Expand Up @@ -100,7 +100,7 @@
</constraints>
</customView>
<button wantsLayer="YES" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="y1M-Np-v9m" userLabel="Secondary Action Button">
<rect key="frame" x="0.0" y="140" width="320" height="20"/>
<rect key="frame" x="0.0" y="108" width="320" height="20"/>
<buttonCell key="cell" type="bevel" title="[Secondary Action]" bezelStyle="rounded" alignment="center" imageScaling="proportionallyDown" inset="2" id="zjo-dD-vux" userLabel="[Secondary Action]">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="systemMedium" size="13"/>
Expand All @@ -113,7 +113,7 @@
</connections>
</button>
<customView appearanceType="darkAqua" translatesAutoresizingMaskIntoConstraints="NO" id="WI9-SH-Yrp" userLabel="Actions Separator View">
<rect key="frame" x="0.0" y="84" width="320" height="44"/>
<rect key="frame" x="0.0" y="52" width="320" height="44"/>
<subviews>
<customView translatesAutoresizingMaskIntoConstraints="NO" id="4nP-3I-NOF" userLabel="Leading Line">
<rect key="frame" x="0.0" y="22" width="145" height="1"/>
Expand Down Expand Up @@ -149,11 +149,11 @@
</constraints>
</customView>
<customView wantsLayer="YES" translatesAutoresizingMaskIntoConstraints="NO" id="3tE-Zi-edS" userLabel="WordPress SSO View">
<rect key="frame" x="0.0" y="0.0" width="320" height="72"/>
<rect key="frame" x="0.0" y="0.0" width="320" height="40"/>
<subviews>
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="sc9-DH-ug9" userLabel="WordPress SSO Button">
<rect key="frame" x="0.0" y="0.0" width="320" height="40"/>
<buttonCell key="cell" type="bevel" title="[WordPress SSO]" bezelStyle="rounded" image="icon_wp" imagePosition="left" alignment="center" imageScaling="proportionallyDown" inset="2" id="Mzh-LI-XpK">
<buttonCell key="cell" type="bevel" title="[WordPress SSO]" bezelStyle="rounded" imagePosition="left" alignment="center" imageScaling="proportionallyDown" inset="2" id="Mzh-LI-XpK">
<behavior key="behavior" lightByContents="YES"/>
<font key="font" metaFont="system" size="16"/>
</buttonCell>
Expand All @@ -167,10 +167,10 @@
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="sc9-DH-ug9" secondAttribute="trailing" id="8Jl-X1-wpa"/>
<constraint firstAttribute="height" constant="72" id="IW2-ZK-7lM"/>
<constraint firstAttribute="height" constant="40" id="IW2-ZK-7lM"/>
<constraint firstAttribute="bottom" secondItem="sc9-DH-ug9" secondAttribute="bottom" id="OYw-Do-eII"/>
<constraint firstItem="sc9-DH-ug9" firstAttribute="leading" secondItem="3tE-Zi-edS" secondAttribute="leading" id="Q4j-qA-c63"/>
<constraint firstItem="sc9-DH-ug9" firstAttribute="top" secondItem="3tE-Zi-edS" secondAttribute="top" priority="999" constant="32" id="k9B-l0-1OW"/>
<constraint firstItem="sc9-DH-ug9" firstAttribute="top" secondItem="3tE-Zi-edS" secondAttribute="top" priority="999" id="k9B-l0-1OW"/>
</constraints>
</customView>
</subviews>
Expand Down Expand Up @@ -224,6 +224,5 @@
</objects>
<resources>
<image name="icon_simplenote_login" width="96" height="96"/>
<image name="icon_wp" width="32" height="32"/>
</resources>
</document>
2 changes: 1 addition & 1 deletion Simplenote/AuthenticationMode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ extension AuthenticationMode {
}

var wordPressSSOFieldHeight: CGFloat {
isWordPressVisible ? CGFloat(72) : .zero
isWordPressVisible ? CGFloat(40) : .zero
}

var passwordFieldAlpha: CGFloat {
Expand Down
4 changes: 4 additions & 0 deletions Simplenote/NSColor+Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a670f8e

Please sign in to comment.