diff --git a/src/ChooseAccountVC.mm b/src/ChooseAccountVC.mm index 040c8ae890f76a948721597deaac3fe6ae71be11..fd183e36a180e318f65e4cbe93784cc598fa98b4 100644 --- a/src/ChooseAccountVC.mm +++ b/src/ChooseAccountVC.mm @@ -37,6 +37,8 @@ #import "views/AccountMenuItemView.h" #import "AccountSelectionManager.h" #import "RingWindowController.h" +#import "utils.h" +#import "views/NSColor+RingTheme.h" @interface ChooseAccountVC () <NSMenuDelegate> @@ -45,6 +47,7 @@ @implementation ChooseAccountVC { __unsafe_unretained IBOutlet NSImageView* profileImage; + __unsafe_unretained IBOutlet NSTextField* accountStatus; __unsafe_unretained IBOutlet NSPopUpButton* accountSelectionButton; const lrc::api::NewAccountModel* accMdl_; AccountSelectionManager* accountSelectionManager_; @@ -69,10 +72,12 @@ NSMenuItem* selectedMenuItem; [profileImage setWantsLayer: YES]; profileImage.layer.cornerRadius = profileImage.frame.size.width / 2; profileImage.layer.masksToBounds = YES; + profileImage.layer.backgroundColor = [[NSColor ringGreyLight] CGColor]; accountsMenu = [[NSMenu alloc] initWithTitle:@""]; [accountsMenu setDelegate:self]; accountSelectionButton.menu = accountsMenu; + [accountSelectionButton setAutoenablesItems:NO]; [self update]; QObject::connect(accMdl_, @@ -107,6 +112,11 @@ NSMenuItem* selectedMenuItem; [self] (const std::string& accountID) { [self update]; }); + QObject::connect(accMdl_, + &lrc::api::NewAccountModel::accountStatusChanged, + [self] (const std::string& accountID) { + [self update]; + }); } -(const lrc::api::account::Info&) selectedAccount @@ -146,29 +156,65 @@ NSMenuItem* selectedMenuItem; menuBarItem.attributedTitle = [self attributedItemTitleForAccount:account]; AccountMenuItemView *itemView = [[AccountMenuItemView alloc] initWithFrame:CGRectZero]; - [itemView.accountLabel setStringValue:@(account.profileInfo.alias.c_str())]; - NSString* userNameString = [self nameForAccount: account]; - [itemView.userNameLabel setStringValue:userNameString]; - switch (account.profileInfo.type) { - case lrc::api::profile::Type::SIP: - [itemView.accountTypeLabel setStringValue:@"SIP"]; - break; - case lrc::api::profile::Type::RING: - [itemView.accountTypeLabel setStringValue:@"RING"]; - break; - default: - break; + [self configureView:itemView forAccount:accId]; + if([@(accId.c_str()) intValue] != 0) { + [menuBarItem setTag:[@(accId.c_str()) intValue]]; } - - bool isAccountAlone = accList.size() == 1; - - [[accountSelectionButton cell] setArrowPosition: (isAccountAlone)?NSPopUpNoArrow:NSPopUpArrowAtBottom]; - [accountSelectionButton setEnabled:!isAccountAlone]; - [menuBarItem setView:itemView]; [accountsMenu addItem:menuBarItem]; [accountsMenu addItem:[NSMenuItem separatorItem]]; } + + // create "add a new account" menu item + NSMenuItem* menuBarItem = [[NSMenuItem alloc] + initWithTitle:@"" + action:nil + keyEquivalent:@""]; + AccountMenuItemView *itemView = [[AccountMenuItemView alloc] initWithFrame:CGRectZero]; + [itemView.accountAvatar setHidden:YES]; + [itemView.accountStatus setHidden:YES]; + [itemView.accountTypeLabel setHidden:YES]; + [itemView.userNameLabel setHidden:YES]; + [itemView.accountLabel setHidden:YES]; + [itemView.createNewAccount setAction:@selector(createNewAccount:)]; + [itemView.createNewAccount setTarget:self]; + [menuBarItem setView: itemView]; + [accountsMenu addItem: menuBarItem]; + [[accountSelectionButton itemAtIndex:[accountsMenu numberOfItems] -1] setEnabled:NO]; +} + +-(void) configureView: (AccountMenuItemView *) itemView forAccount:(const std::string&) accountId { + auto& account = accMdl_->getAccountInfo(accountId); + [itemView.accountLabel setStringValue:@(account.profileInfo.alias.c_str())]; + NSString* userNameString = [self nameForAccount: account]; + [itemView.userNameLabel setStringValue:userNameString]; + QByteArray ba = QByteArray::fromStdString(account.profileInfo.avatar); + QVariant photo = GlobalInstances::pixmapManipulator().personPhoto(ba, nil); + if(QtMac::toNSImage(qvariant_cast<QPixmap>(photo))) { + [itemView.accountAvatar setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(photo))]; + } else { + [itemView.accountAvatar setImage: [NSImage imageNamed:@"default_avatar_overlay.png"]]; + } + BOOL accountNotRegistered = account.status == lrc::api::account::Status::REGISTERED ? NO : YES; + [itemView.accountStatus setHidden:accountNotRegistered]; + switch (account.profileInfo.type) { + case lrc::api::profile::Type::SIP: + [itemView.accountTypeLabel setStringValue:@"SIP"]; + break; + case lrc::api::profile::Type::RING: + [itemView.accountTypeLabel setStringValue:@"RING"]; + break; + default: + break; + } + [itemView.createNewAccount setHidden:YES]; + [itemView.createNewAccountImage setHidden:YES]; +} + + +- (void)createNewAccount:(id)sender { + [accountSelectionButton.menu cancelTrackingWithoutAnimation]; + [delegate createNewAccount]; } -(void) updatePhoto @@ -181,7 +227,13 @@ NSMenuItem* selectedMenuItem; QByteArray ba = QByteArray::fromStdString(account.profileInfo.avatar); QVariant photo = GlobalInstances::pixmapManipulator().personPhoto(ba, nil); - [profileImage setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(photo))]; + if(QtMac::toNSImage(qvariant_cast<QPixmap>(photo))) { + [profileImage setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(photo))]; + } else { + [profileImage setImage: [NSImage imageNamed:@"default_avatar_overlay.png"]]; + } + BOOL accountNotRegistered = account.status == lrc::api::account::Status::REGISTERED ? NO : YES; + [accountStatus setHidden:accountNotRegistered]; } @catch (NSException *ex) { NSLog(@"Caught exception %@: %@", [ex name], [ex reason]); @@ -189,23 +241,22 @@ NSMenuItem* selectedMenuItem; } -(NSString*) nameForAccount:(const lrc::api::account::Info&) account { - auto name = account.registeredName; - return @(name.c_str()); + return bestIDForAccount(account); } -(NSString*) itemTitleForAccount:(const lrc::api::account::Info&) account { - NSString* alias = @(account.profileInfo.alias.c_str()); + NSString* alias = bestNameForAccount(account); NSString* userNameString = [self nameForAccount: account]; - if([userNameString length] > 0) { + if(![alias isEqualToString:userNameString]) { alias = [NSString stringWithFormat: @"%@\n", alias]; } return [alias stringByAppendingString:userNameString]; } - (NSAttributedString*) attributedItemTitleForAccount:(const lrc::api::account::Info&) account { - NSString* alias = @(account.profileInfo.alias.c_str()); + NSString* alias = bestNameForAccount(account); NSString* userNameString = [self nameForAccount: account]; - if([userNameString length] > 0){ + if(![alias isEqualToString:userNameString]) { alias = [NSString stringWithFormat: @"%@\n", alias]; } NSFont *fontAlias = [NSFont userFontOfSize:14.0]; diff --git a/src/RingWindowController.h b/src/RingWindowController.h index 8949c895ab58e08673314134e280661026d37a19..a54cfc7edaac6ea567e267300c490f05749c902f 100644 --- a/src/RingWindowController.h +++ b/src/RingWindowController.h @@ -79,4 +79,6 @@ namespace lrc { */ -(void)allAccountsDeleted; +- (void) createNewAccount; + @end diff --git a/src/RingWindowController.mm b/src/RingWindowController.mm index 0527f2d05d89f03cab2e35231eb25c473ae3c1e2..2000f30ed1c76472df41f339e00ffa21578109b0 100644 --- a/src/RingWindowController.mm +++ b/src/RingWindowController.mm @@ -55,10 +55,12 @@ #import "views/BackgroundView.h" #import "ChooseAccountVC.h" #import "utils.h" +#import "RingWizardWC.h" @interface RingWindowController () <MigrateRingAccountsDelegate, NSToolbarDelegate> @property (retain) MigrateRingAccountsWC* migrateWC; +@property RingWizardWC* wizard; @end @@ -87,6 +89,7 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; NSString* const kChangeAccountToolBarItemIdentifier = @"ChangeAccountToolBarItemIdentifier"; @synthesize dataTransferModel, accountModel, behaviorController; +@synthesize wizard; -(id) initWithWindowNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil accountModel:( lrc::api::NewAccountModel*)accountModel dataTransferModel:( lrc::api::DataTransferModel*)dataTransferModel behaviourController:( lrc::api::BehaviorController*) behaviorController { @@ -448,4 +451,11 @@ NSString* const kChangeAccountToolBarItemIdentifier = @"ChangeAccountToolBarIte return nil; } +- (void) createNewAccount { + wizard = [[RingWizardWC alloc] initWithNibName:@"RingWizard" bundle: nil accountmodel: self.accountModel]; + [wizard showChooseWithCancelButton: YES andAdvanced: YES]; + [self.window beginSheet:wizard.window completionHandler:nil]; + [wizard showWindow:self]; +} + @end diff --git a/src/utils.h b/src/utils.h index 28290eeae93999b9ef3c5d556c6468b68061ed07..2ca45c9d0fd9bf64b635a966752a3e839a6996f5 100755 --- a/src/utils.h +++ b/src/utils.h @@ -46,6 +46,22 @@ static inline NSString* bestIDForConversation(const lrc::api::conversation::Info return [@(contact.profileInfo.uri.c_str()) removeEmptyLinesAtBorders]; } +static inline NSString* bestIDForAccount(const lrc::api::account::Info& account) +{ + if (!account.registeredName.empty()) { + return [@(account.registeredName.c_str()) removeEmptyLinesAtBorders]; + } + return [@(account.profileInfo.uri.c_str()) removeEmptyLinesAtBorders]; +} + +static inline NSString* bestNameForAccount(const lrc::api::account::Info& account) +{ + if (account.profileInfo.alias.empty()) { + return bestIDForAccount(account); + } + return @(account.profileInfo.alias.c_str()); +} + static inline NSString* bestNameForConversation(const lrc::api::conversation::Info& conv, const lrc::api::ConversationModel& model) { auto contact = model.owner.contactModel->getContact(conv.participants[0]); diff --git a/src/views/AccountMenuItemView.h b/src/views/AccountMenuItemView.h index 038a122cf7845ab1ce5a090d7878113f93d3c7da..04ab3ac974188196352a6013cb5fc7a442bfade8 100644 --- a/src/views/AccountMenuItemView.h +++ b/src/views/AccountMenuItemView.h @@ -25,6 +25,10 @@ @property (nonatomic, strong) IBOutlet NSTextField* accountLabel; @property (nonatomic, strong) IBOutlet NSTextField* userNameLabel; @property (nonatomic, strong) IBOutlet NSTextField* accountTypeLabel; +@property (nonatomic, strong) IBOutlet NSBox* backgroundView; +@property (nonatomic, strong) IBOutlet NSImageView* accountAvatar; @property (nonatomic, strong) IBOutlet NSTextField* accountStatus; +@property (nonatomic, strong) IBOutlet NSButton* createNewAccount; +@property (nonatomic, strong) IBOutlet NSImageView* createNewAccountImage; @end diff --git a/src/views/AccountMenuItemView.mm b/src/views/AccountMenuItemView.mm index 8b8a3aaa55508df7f793e43fd793d03ac2a225be..c126a2deac960760891c15f1db417f438cd196e2 100644 --- a/src/views/AccountMenuItemView.mm +++ b/src/views/AccountMenuItemView.mm @@ -46,6 +46,11 @@ self.frame = viewFromXib.frame; self.containerView = viewFromXib; [self addSubview:self.containerView]; + [self.accountAvatar setWantsLayer:YES]; + self.accountAvatar.layer.cornerRadius = self.accountAvatar.frame.size.width * 0.5; + self.accountAvatar.layer.masksToBounds = YES; + [self.accountStatus setWantsLayer:YES]; + [self.accountAvatar.layer setBackgroundColor:[[NSColor ringGreyLight] CGColor]]; } } @@ -64,11 +69,11 @@ NSMenuItem *menuItem = ([self enclosingMenuItem]); BOOL isHighlighted = [menuItem isHighlighted]; if (isHighlighted) { - [[NSColor ringGreyHighlight] set]; - [NSBezierPath fillRect:rect]; + [self.backgroundView setFillColor:[NSColor controlLightHighlightColor]]; } else { - [super drawRect: rect]; + [self.backgroundView setFillColor:[NSColor controlColor]]; } + [super drawRect: rect]; } @end diff --git a/ui/Base.lproj/AccountMenuItemView.xib b/ui/Base.lproj/AccountMenuItemView.xib index c5a39089a68bcc8165fc6f32a7b9c18cf1d7250d..a00f8d065de0eedd00793d7a6dd7ee4b00795a18 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,34 +69,59 @@ <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> - <textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Label" id="gOS-aC-TGo"> - <font key="font" metaFont="cellTitle"/> - <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> + <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="8" y="4" width="127" height="20"/> - <constraints> - <constraint firstAttribute="height" constant="20" id="14e-51-tZ3"/> - </constraints> + <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> - <textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="ttQ-VU-CG6"> - <rect key="frame" x="133" y="4" width="120" height="20"/> + <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="x9W-YM-xpS"/> + <constraint firstAttribute="height" constant="20" id="7xp-S1-EWG"/> + <constraint firstAttribute="width" constant="20" id="QGs-sS-H6l"/> </constraints> - <textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="right" title="Label" id="hUP-Wr-xwZ"> + <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"/> <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/> <color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/> @@ -66,17 +129,33 @@ </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 d929053367eb777344a75c13d594cf3ae4ccaab9..7ad0989d47bef25ab3e305b31db03c12fcfa7fae 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>