account: refactor account selection
Change-Id: Ib45a5388d6e6860970c1dd2a31709d0aaea123d2
Reviewed-by: Andreas Traczyk <andreas.traczyk@savoirfairelinux.com>
diff --git a/ui/Base.lproj/AccountMenuItemView.xib b/ui/Base.lproj/AccountMenuItemView.xib
index c5a3908..a00f8d0 100644
--- a/ui/Base.lproj/AccountMenuItemView.xib
+++ b/ui/Base.lproj/AccountMenuItemView.xib
@@ -1,27 +1,65 @@
<?xml version="1.0" encoding="UTF-8"?>
-<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
+<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14113" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
- <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
+ <plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14113"/>
+ <capability name="box content view" minToolsVersion="7.0"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="AccountMenuItemView">
<connections>
+ <outlet property="accountAvatar" destination="XKc-lc-K67" id="Pfu-lm-V66"/>
<outlet property="accountLabel" destination="V91-eS-dUh" id="MNE-TY-RqK"/>
- <outlet property="accountStatus" destination="ttQ-VU-CG6" id="yqr-dK-eY0"/>
+ <outlet property="accountState" destination="TdK-5g-ddU" id="6DG-YN-nZt"/>
+ <outlet property="accountStatus" destination="TdK-5g-ddU" id="bzV-if-XBF"/>
<outlet property="accountTypeLabel" destination="0PP-Di-b7L" id="O6c-L9-jBr"/>
+ <outlet property="backgroundView" destination="ZIZ-jd-eLK" id="QTx-8z-4zA"/>
<outlet property="containerView" destination="Hz6-mo-xeY" id="t5f-yD-zPi"/>
+ <outlet property="createNewAccount" destination="BkF-b3-tzE" id="fcw-Qc-dRy"/>
+ <outlet property="createNewAccountImage" destination="IyH-ia-I3z" id="4uD-jE-Svj"/>
<outlet property="userNameLabel" destination="tLn-uH-gZ6" id="pGG-sb-IlW"/>
</connections>
</customObject>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customView id="Hz6-mo-xeY">
- <rect key="frame" x="0.0" y="0.0" width="256" height="50"/>
+ <rect key="frame" x="0.0" y="0.0" width="230" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
+ <box boxType="custom" borderType="none" cornerRadius="4" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="ZIZ-jd-eLK">
+ <rect key="frame" x="0.0" y="0.0" width="230" height="50"/>
+ <view key="contentView" id="rZm-2b-CxI">
+ <rect key="frame" x="0.0" y="0.0" width="230" height="50"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ </view>
+ <constraints>
+ <constraint firstAttribute="width" constant="230" id="Wi8-FI-fcq"/>
+ </constraints>
+ <color key="fillColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </box>
+ <button toolTip="Create New Account" horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="BkF-b3-tzE" customClass="HoverButton">
+ <rect key="frame" x="0.0" y="2" width="230" height="48"/>
+ <buttonCell key="cell" type="square" bezelStyle="shadowlessSquare" imagePosition="overlaps" alignment="center" transparent="YES" imageScaling="proportionallyDown" id="lfv-A5-Wu4">
+ <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+ <font key="font" metaFont="system"/>
+ </buttonCell>
+ <userDefinedRuntimeAttributes>
+ <userDefinedRuntimeAttribute type="color" keyPath="hoverColor">
+ <color key="value" red="1" green="1" blue="1" alpha="0.83999999999999997" colorSpace="calibratedRGB"/>
+ </userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="color" keyPath="imageColor">
+ <color key="value" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
+ </userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="number" keyPath="imageInsets">
+ <integer key="value" value="0"/>
+ </userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="number" keyPath="cornerRadius">
+ <integer key="value" value="0"/>
+ </userDefinedRuntimeAttribute>
+ </userDefinedRuntimeAttributes>
+ </button>
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="V91-eS-dUh">
- <rect key="frame" x="8" y="25" width="44" height="20"/>
+ <rect key="frame" x="48" y="25" width="44" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="VWk-wM-WSB"/>
</constraints>
@@ -31,10 +69,57 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
- <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0PP-Di-b7L">
- <rect key="frame" x="218" y="25" width="35" height="20"/>
+ <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" tag="100" translatesAutoresizingMaskIntoConstraints="NO" id="XKc-lc-K67">
+ <rect key="frame" x="5" y="5" width="40" height="40"/>
<constraints>
- <constraint firstAttribute="height" constant="20" id="byN-LO-mgw"/>
+ <constraint firstAttribute="height" constant="40" id="2Pd-xj-eIf"/>
+ <constraint firstAttribute="width" constant="40" id="IEA-OA-uSx"/>
+ </constraints>
+ <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageAlignment="right" imageScaling="proportionallyDown" id="B0y-e0-cVi"/>
+ </imageView>
+ <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" tag="500" translatesAutoresizingMaskIntoConstraints="NO" id="TdK-5g-ddU" userLabel="AccountState" customClass="RoundedTextField">
+ <rect key="frame" x="33" y="5" width="14" height="14"/>
+ <constraints>
+ <constraint firstAttribute="height" constant="13.5" id="Mj5-H6-ylc"/>
+ <constraint firstAttribute="width" constant="9.5" id="aYl-Xd-vky"/>
+ </constraints>
+ <textFieldCell key="cell" enabled="NO" sendsActionOnEndEditing="YES" alignment="center" id="Fhc-ch-Cek">
+ <font key="font" metaFont="system"/>
+ <color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ <userDefinedRuntimeAttributes>
+ <userDefinedRuntimeAttribute type="color" keyPath="bgColor">
+ <color key="value" red="0.29803921570000003" green="0.85098039219999999" blue="0.3921568627" alpha="1" colorSpace="calibratedRGB"/>
+ </userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+ <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ </userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="number" keyPath="borderThickness">
+ <real key="value" value="0.5"/>
+ </userDefinedRuntimeAttribute>
+ </userDefinedRuntimeAttributes>
+ </textField>
+ <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tLn-uH-gZ6">
+ <rect key="frame" x="48" y="5" width="35" height="16"/>
+ <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" title="Label" id="uPR-fc-nOP">
+ <font key="font" metaFont="cellTitle"/>
+ <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="IyH-ia-I3z">
+ <rect key="frame" x="105" y="15" width="20" height="20"/>
+ <constraints>
+ <constraint firstAttribute="height" constant="20" id="7xp-S1-EWG"/>
+ <constraint firstAttribute="width" constant="20" id="QGs-sS-H6l"/>
+ </constraints>
+ <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyUpOrDown" image="NSAddTemplate" id="9b9-Jo-NAF"/>
+ </imageView>
+ <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="0PP-Di-b7L">
+ <rect key="frame" x="192" y="25" width="35" height="20"/>
+ <constraints>
+ <constraint firstAttribute="height" constant="20" id="8mL-jo-3Kb"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Label" id="gOS-aC-TGo">
<font key="font" metaFont="cellTitle"/>
@@ -42,41 +127,35 @@
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
- <textField horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="tLn-uH-gZ6">
- <rect key="frame" x="8" y="4" width="127" height="20"/>
- <constraints>
- <constraint firstAttribute="height" constant="20" id="14e-51-tZ3"/>
- </constraints>
- <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" title="Label" id="uPR-fc-nOP">
- <font key="font" metaFont="cellTitle"/>
- <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- </textField>
- <textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ttQ-VU-CG6">
- <rect key="frame" x="133" y="4" width="120" height="20"/>
- <constraints>
- <constraint firstAttribute="height" constant="20" id="x9W-YM-xpS"/>
- </constraints>
- <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Label" id="hUP-Wr-xwZ">
- <font key="font" metaFont="cellTitle"/>
- <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
- <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
- </textFieldCell>
- </textField>
</subviews>
<constraints>
- <constraint firstAttribute="trailing" secondItem="0PP-Di-b7L" secondAttribute="trailing" constant="5" id="06l-MI-wFL"/>
- <constraint firstItem="0PP-Di-b7L" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="5" id="1dl-87-aZ5"/>
- <constraint firstItem="tLn-uH-gZ6" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="10" id="9RA-EK-KN6"/>
- <constraint firstAttribute="bottom" secondItem="tLn-uH-gZ6" secondAttribute="bottom" constant="4" id="QNf-aN-2HB"/>
+ <constraint firstAttribute="trailing" secondItem="BkF-b3-tzE" secondAttribute="trailing" id="4zr-zt-tNR"/>
+ <constraint firstItem="IyH-ia-I3z" firstAttribute="centerX" secondItem="Hz6-mo-xeY" secondAttribute="centerX" id="6of-Nf-Di4"/>
+ <constraint firstItem="0PP-Di-b7L" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="5" id="7h7-LT-HCJ"/>
+ <constraint firstAttribute="bottom" secondItem="BkF-b3-tzE" secondAttribute="bottom" constant="2" id="Erj-JK-1Jc"/>
+ <constraint firstAttribute="trailing" secondItem="0PP-Di-b7L" secondAttribute="trailing" constant="5" id="GU6-yw-2Nu"/>
+ <constraint firstItem="BkF-b3-tzE" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="M0t-ie-V4X"/>
+ <constraint firstItem="TdK-5g-ddU" firstAttribute="trailing" secondItem="XKc-lc-K67" secondAttribute="trailing" id="NU8-DL-jhB"/>
+ <constraint firstItem="0PP-Di-b7L" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="tLn-uH-gZ6" secondAttribute="trailing" constant="20" id="Nb4-Z8-9Ul"/>
+ <constraint firstItem="TdK-5g-ddU" firstAttribute="bottom" secondItem="XKc-lc-K67" secondAttribute="bottom" id="PGs-u9-1qr"/>
+ <constraint firstAttribute="bottom" secondItem="tLn-uH-gZ6" secondAttribute="bottom" constant="5" id="QNf-aN-2HB"/>
+ <constraint firstAttribute="bottom" secondItem="ZIZ-jd-eLK" secondAttribute="bottom" id="RRa-dJ-Zbr"/>
+ <constraint firstItem="ZIZ-jd-eLK" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="Rl2-Z2-XC6"/>
+ <constraint firstAttribute="bottom" secondItem="XKc-lc-K67" secondAttribute="bottom" constant="5" id="SOc-zB-t6m"/>
<constraint firstItem="V91-eS-dUh" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="5" id="SQI-pe-c4a"/>
- <constraint firstItem="ttQ-VU-CG6" firstAttribute="leading" secondItem="tLn-uH-gZ6" secondAttribute="trailing" constant="2" id="XN5-dq-qgC"/>
- <constraint firstAttribute="trailing" secondItem="tLn-uH-gZ6" secondAttribute="trailing" constant="123" id="iGm-Yn-ZeI"/>
- <constraint firstAttribute="trailing" secondItem="ttQ-VU-CG6" secondAttribute="trailing" constant="5" id="sah-hr-nae"/>
- <constraint firstItem="V91-eS-dUh" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="10" id="uR0-19-mAW"/>
- <constraint firstItem="ttQ-VU-CG6" firstAttribute="baseline" secondItem="tLn-uH-gZ6" secondAttribute="baseline" id="wjM-KO-5fV"/>
+ <constraint firstItem="XKc-lc-K67" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" constant="5" id="TUF-fx-zE7"/>
+ <constraint firstItem="tLn-uH-gZ6" firstAttribute="leading" secondItem="V91-eS-dUh" secondAttribute="leading" id="WcF-NN-pmz"/>
+ <constraint firstItem="ZIZ-jd-eLK" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="X9L-7K-HGm"/>
+ <constraint firstItem="0PP-Di-b7L" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="V91-eS-dUh" secondAttribute="trailing" constant="20" id="ZH1-rk-GX6"/>
+ <constraint firstItem="IyH-ia-I3z" firstAttribute="centerY" secondItem="Hz6-mo-xeY" secondAttribute="centerY" id="hQd-Pw-y4Q"/>
+ <constraint firstItem="XKc-lc-K67" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" constant="5" id="ipM-Ca-Man"/>
+ <constraint firstAttribute="trailing" secondItem="ZIZ-jd-eLK" secondAttribute="trailing" id="nIe-my-eAj"/>
+ <constraint firstItem="V91-eS-dUh" firstAttribute="leading" secondItem="XKc-lc-K67" secondAttribute="trailing" constant="5" id="rBn-Ol-rkr"/>
+ <constraint firstItem="BkF-b3-tzE" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="yKW-iG-nvv"/>
</constraints>
</customView>
</objects>
+ <resources>
+ <image name="NSAddTemplate" width="11" height="11"/>
+ </resources>
</document>
diff --git a/ui/Base.lproj/ChooseAccount.xib b/ui/Base.lproj/ChooseAccount.xib
index d929053..7ad0989 100644
--- a/ui/Base.lproj/ChooseAccount.xib
+++ b/ui/Base.lproj/ChooseAccount.xib
@@ -9,6 +9,7 @@
<customObject id="-2" userLabel="File's Owner" customClass="ChooseAccountVC">
<connections>
<outlet property="accountSelectionButton" destination="sMr-ym-Q7q" id="aWB-iE-k1f"/>
+ <outlet property="accountStatus" destination="3O0-W6-QCM" id="5i7-92-c94"/>
<outlet property="profileImage" destination="JSg-rZ-Xia" id="keh-R2-VI8"/>
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
</connections>
@@ -26,19 +27,42 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="JSg-rZ-Xia">
- <rect key="frame" x="5" y="0.0" width="30" height="30"/>
+ <rect key="frame" x="13" y="0.0" width="30" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="V0B-Kr-2Kw"/>
<constraint firstAttribute="width" constant="30" id="b29-LU-Chc"/>
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" id="riX-D8-veh"/>
</imageView>
+ <textField horizontalHuggingPriority="750" verticalHuggingPriority="750" tag="500" translatesAutoresizingMaskIntoConstraints="NO" id="3O0-W6-QCM" userLabel="AccountStatus" customClass="RoundedTextField">
+ <rect key="frame" x="35" y="0.0" width="10" height="11"/>
+ <constraints>
+ <constraint firstAttribute="width" constant="6.5" id="4Ks-ia-6rg"/>
+ <constraint firstAttribute="height" constant="10.5" id="GGv-tJ-9Ps"/>
+ </constraints>
+ <textFieldCell key="cell" enabled="NO" sendsActionOnEndEditing="YES" alignment="center" id="Wdm-ve-lDX">
+ <font key="font" metaFont="system"/>
+ <color key="textColor" white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
+ <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ <userDefinedRuntimeAttributes>
+ <userDefinedRuntimeAttribute type="color" keyPath="bgColor">
+ <color key="value" red="0.29803921570000003" green="0.85098039219999999" blue="0.3921568627" alpha="1" colorSpace="calibratedRGB"/>
+ </userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="color" keyPath="borderColor">
+ <color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
+ </userDefinedRuntimeAttribute>
+ <userDefinedRuntimeAttribute type="number" keyPath="borderThickness">
+ <real key="value" value="0.5"/>
+ </userDefinedRuntimeAttribute>
+ </userDefinedRuntimeAttributes>
+ </textField>
<popUpButton translatesAutoresizingMaskIntoConstraints="NO" id="sMr-ym-Q7q">
<rect key="frame" x="38" y="6" width="159" height="19"/>
<constraints>
<constraint firstAttribute="width" constant="155" id="RHk-BK-YeF"/>
</constraints>
- <popUpButtonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" lineBreakMode="truncatingTail" state="on" borderStyle="bezel" inset="2" selectedItem="CTF-me-3R0" id="AKJ-ja-nkI">
+ <popUpButtonCell key="cell" type="check" bezelStyle="regularSquare" imagePosition="left" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="bezel" inset="2" selectedItem="CTF-me-3R0" id="AKJ-ja-nkI">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system" size="16"/>
<menu key="menu" id="R46-PB-Vne">
@@ -58,10 +82,12 @@
</subviews>
<constraints>
<constraint firstAttribute="trailing" secondItem="sMr-ym-Q7q" secondAttribute="trailing" constant="5" id="BD9-ZS-cZa"/>
- <constraint firstItem="sMr-ym-Q7q" firstAttribute="leading" secondItem="JSg-rZ-Xia" secondAttribute="trailing" constant="5" id="L9t-7Q-Cw2"/>
+ <constraint firstItem="sMr-ym-Q7q" firstAttribute="leading" secondItem="JSg-rZ-Xia" secondAttribute="trailing" constant="-3" id="L9t-7Q-Cw2"/>
<constraint firstItem="JSg-rZ-Xia" firstAttribute="top" secondItem="HA7-fk-gse" secondAttribute="top" id="Rw2-Sd-7Hz"/>
<constraint firstItem="sMr-ym-Q7q" firstAttribute="centerY" secondItem="JSg-rZ-Xia" secondAttribute="centerY" id="S2w-ph-Hue"/>
<constraint firstAttribute="bottom" secondItem="JSg-rZ-Xia" secondAttribute="bottom" id="VyP-Jt-INt"/>
+ <constraint firstItem="3O0-W6-QCM" firstAttribute="trailing" secondItem="JSg-rZ-Xia" secondAttribute="trailing" id="ogd-CG-BuC"/>
+ <constraint firstItem="3O0-W6-QCM" firstAttribute="bottom" secondItem="JSg-rZ-Xia" secondAttribute="bottom" id="r5p-jD-VkY"/>
</constraints>
</view>
</box>