Commit 13b7688e authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Alexandre Lision

account: Add selected account in Toolbar

This commit add dropdown list to toolbar to change currently selected account.
After selection it update ring id used to share account info.

Tuleap: #1532
Change-Id: I9fe3e65513ec45dce8bd53d8611f4daca6081663
Reviewed-by: default avatarAlexandre Lision <alexandre.lision@savoirfairelinux.com>
parent 062eddf0
...@@ -158,6 +158,8 @@ SET(ringclient_CONTROLLERS ...@@ -158,6 +158,8 @@ SET(ringclient_CONTROLLERS
src/DialpadWC.h src/DialpadWC.h
src/RegisterNameWC.mm src/RegisterNameWC.mm
src/RegisterNameWC.h src/RegisterNameWC.h
src/ChooseAccountVC.h
src/ChooseAccountVC.mm
) )
SET(ringclient_BACKENDS SET(ringclient_BACKENDS
...@@ -186,7 +188,9 @@ SET(ringclient_VIEWS ...@@ -186,7 +188,9 @@ SET(ringclient_VIEWS
src/views/BackgroundView.h src/views/BackgroundView.h
src/views/BackgroundView.mm src/views/BackgroundView.mm
src/views/IMTableCellView.h src/views/IMTableCellView.h
src/views/IMTableCellView.mm) src/views/IMTableCellView.mm
src/views/AccountMenuItemView.h
src/views/AccountMenuItemView.mm)
SET(ringclient_OTHERS SET(ringclient_OTHERS
src/main.mm src/main.mm
...@@ -228,6 +232,8 @@ SET(ringclient_XIBS ...@@ -228,6 +232,8 @@ SET(ringclient_XIBS
RingWizardChoose RingWizardChoose
Dialpad Dialpad
RegisterNameWindow RegisterNameWindow
ChooseAccount
AccountMenuItemView
) )
# Icons # Icons
......
/*
* Copyright (C) 2015-2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import <Cocoa/Cocoa.h>
@interface ChooseAccountVC : NSViewController
@end
/*
* Copyright (C) 2015-2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import "ChooseAccountVC.h"
//Qt
#import <QSize>
#import <QtMacExtras/qmacfunctions.h>
#import <QPixmap>
//LRC
#import <profilemodel.h>
#import <profile.h>
#import <person.h>
#import <globalinstances.h>
#import <accountmodel.h>
#import <account.h>
#import <QItemSelectionModel.h>
#import <interfaces/pixmapmanipulatori.h>
//RING
#import "views/AccountMenuItemView.h"
@interface ChooseAccountVC () <NSMenuDelegate>
@end
@implementation ChooseAccountVC {
__unsafe_unretained IBOutlet NSImageView* profileImage;
__unsafe_unretained IBOutlet NSPopUpButton* accountSelectionButton;
}
Boolean menuIsOpen;
Boolean menuNeedsUpdate;
NSMenu* accountsMenu;
NSMenuItem* selectedMenuItem;
QMetaObject::Connection accountUpdate;
- (void)awakeFromNib
{
[profileImage setWantsLayer: YES];
profileImage.layer.cornerRadius = profileImage.frame.size.width / 2;
profileImage.layer.masksToBounds = YES;
if (auto pro = ProfileModel::instance().selectedProfile()) {
auto photo = GlobalInstances::pixmapManipulator().contactPhoto(pro->person(), {140,140});
[profileImage setImage:QtMac::toNSImage(qvariant_cast<QPixmap>(photo))];
}
accountsMenu = [[NSMenu alloc] initWithTitle:@""];
[accountsMenu setDelegate:self];
accountSelectionButton.menu = accountsMenu;
[self update];
QObject::disconnect(accountUpdate);
accountUpdate = QObject::connect(&AccountModel::instance(),
&AccountModel::dataChanged,
[=] {
[self update];
});
}
-(void) updateMenu {
[accountsMenu removeAllItems];
QList<Account*> allAccounts = AccountModel::instance().getAccountsByProtocol(Account::Protocol::RING);
NSLog(@"numberOfaccounts: %d", allAccounts.count());
for (auto account : allAccounts) {
NSMenuItem* menuBarItem = [[NSMenuItem alloc]
initWithTitle:[self itemTitleForAccount:account] action:NULL keyEquivalent:@""];
menuBarItem.attributedTitle = [self attributedItemTitleForAccount:account];
AccountMenuItemView *itemView = [[AccountMenuItemView alloc] initWithFrame:CGRectZero];
[itemView.accountLabel setStringValue:account->alias().toNSString()];
NSString* userNameString = [self nameForAccount: account];
[itemView.userNameLabel setStringValue:userNameString];
[itemView.accountTypeLabel setStringValue:@"Ring"];
auto humanState = account->toHumanStateName();
[itemView.accountStatus setStringValue:humanState.toNSString()];
[menuBarItem setView:itemView];
[accountsMenu addItem:menuBarItem];
[accountsMenu addItem:[NSMenuItem separatorItem]];
}
}
-(NSString*) nameForAccount:(Account*) account {
auto name = account->registeredName();
NSString* userNameString = nullptr;
if (!name.isNull() && !name.isEmpty()) {
userNameString = name.toNSString();
} else {
userNameString = account->username().toNSString();
}
return userNameString;
}
-(NSString*) itemTitleForAccount:(Account*) account {
NSString* alias = account->alias().toNSString();
alias = [NSString stringWithFormat: @"%@\n", alias];
NSString* userNameString = [self nameForAccount: account];
return [alias stringByAppendingString:userNameString];
}
- (NSAttributedString*) attributedItemTitleForAccount:(Account*) account {
NSString* alias = account->alias().toNSString();
alias = [NSString stringWithFormat: @"%@\n", alias];
NSString* userNameString = [self nameForAccount: account];
NSFont *fontAlias = [NSFont userFontOfSize:14.0];
NSFont *fontUserName = [NSFont userFontOfSize:11.0];
NSColor *colorAlias = [NSColor labelColor];
NSColor *colorAUserName = [NSColor secondaryLabelColor];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.lineBreakMode = NSLineBreakByTruncatingTail;
NSDictionary *aliasAttrs = [NSDictionary dictionaryWithObjectsAndKeys:fontAlias,NSFontAttributeName,
colorAlias,NSForegroundColorAttributeName,
paragraphStyle,NSParagraphStyleAttributeName, nil];
NSDictionary *userNameAttrs = [NSDictionary dictionaryWithObjectsAndKeys:fontUserName,NSFontAttributeName,
colorAUserName,NSForegroundColorAttributeName,
paragraphStyle,NSParagraphStyleAttributeName, nil];
NSAttributedString* attributedString = [[NSAttributedString alloc] initWithString:alias attributes:aliasAttrs];
NSAttributedString* attributedStringSecond= [[NSAttributedString alloc] initWithString:userNameString attributes:userNameAttrs];
NSMutableAttributedString *result = [[NSMutableAttributedString alloc] init];
[result appendAttributedString:attributedString];
[result appendAttributedString:attributedStringSecond];
return result;
}
-(Account *)selectedAccount {
Account* finalChoice = nullptr;
finalChoice = AccountModel::instance().userChosenAccount();
if(finalChoice == nil) {
Account* registered = nullptr;
Account* enabled = nullptr;
auto ringList = AccountModel::instance().getAccountsByProtocol(Account::Protocol::RING);
for (int i = 0 ; i < ringList.size() && !registered ; ++i) {
auto account = ringList.value(i);
if (account->isEnabled()) {
if(!enabled) {
enabled = finalChoice = account;
}
if (account->registrationState() == Account::RegistrationState::READY) {
registered = enabled = finalChoice = account;
}
} else {
if (!finalChoice) {
finalChoice = account;
}
}
}
}
return finalChoice;
}
-(void) update {
if(menuIsOpen) {
return;
}
[self updateMenu];
[self chooseAccount];
}
-(void) chooseAccount {
if(accountsMenu.itemArray.count == 0) {
[self.view setHidden:YES];
return;
}
Account* selectedAccount = [self selectedAccount];
NSString *itemTitle = [self itemTitleForAccount:selectedAccount];
if([accountSelectionButton itemWithTitle:itemTitle]){
[accountSelectionButton selectItemWithTitle:itemTitle];
// check if chosen account is the same as selected in popup button. If yes we don.t need setUserChosenAccount
Account* choosenaccount = AccountModel::instance().userChosenAccount();
if (choosenaccount && [itemTitle isEqualToString:[self itemTitleForAccount:choosenaccount]]){
return;
}
AccountModel::instance().setUserChosenAccount(selectedAccount);
}
}
#pragma mark - NSPopUpButton item selection
- (IBAction)itemChanged:(id)sender {
NSInteger index = [(NSPopUpButton *)sender indexOfSelectedItem];
QList<Account*> allAccounts = AccountModel::instance().getAccountsByProtocol(Account::Protocol::RING);
// menu contains accounts and separation lines, so divide it by 2 to get account index
Account *selectedAccount = allAccounts.at(index/2);
AccountModel::instance().setUserChosenAccount(selectedAccount);
}
#pragma mark - NSMenuDelegate
- (void)menuWillOpen:(NSMenu *)menu {
menuIsOpen = true;
// remember selected item to remove highlighting when menu is open
selectedMenuItem = [accountSelectionButton selectedItem];
}
- (void)menuDidClose:(NSMenu *)menu {
menuIsOpen = false;
}
- (void)menu:(NSMenu *)menu willHighlightItem:(nullable NSMenuItem *)item {
if (!selectedMenuItem || selectedMenuItem == item) {
return;
}
int index = [menu indexOfItem:selectedMenuItem];
[menu removeItemAtIndex:index];
[menu insertItem:selectedMenuItem atIndex:index];
[accountSelectionButton selectItemAtIndex:index];
selectedMenuItem = nil;
}
@end
...@@ -42,8 +42,9 @@ ...@@ -42,8 +42,9 @@
#import "views/IconButton.h" #import "views/IconButton.h"
#import "views/NSColor+RingTheme.h" #import "views/NSColor+RingTheme.h"
#import "views/BackgroundView.h" #import "views/BackgroundView.h"
#import "ChooseAccountVC.h"
@interface RingWindowController () <MigrateRingAccountsDelegate> @interface RingWindowController () <MigrateRingAccountsDelegate, NSToolbarDelegate>
@property (retain) MigrateRingAccountsWC* migrateWC; @property (retain) MigrateRingAccountsWC* migrateWC;
...@@ -64,20 +65,23 @@ ...@@ -64,20 +65,23 @@
CurrentCallVC* currentCallVC; CurrentCallVC* currentCallVC;
ConversationVC* offlineVC; ConversationVC* offlineVC;
ChooseAccountVC* chooseAccountVC;
} }
QMetaObject::Connection accountUpdate;
static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier";
NSString* const kChangeAccountToolBarItemIdentifier = @"ChangeAccountToolBarItemIdentifier";
- (void)windowDidLoad { - (void)windowDidLoad {
[super windowDidLoad]; [super windowDidLoad];
[self.window setMovableByWindowBackground:YES]; [self.window setMovableByWindowBackground:YES];
[self.window setBackgroundColor:[NSColor colorWithRed:242.0/255 green:242.0/255 blue:242.0/255 alpha:1.0]]; [self.window setBackgroundColor:[NSColor colorWithRed:242.0/255 green:242.0/255 blue:242.0/255 alpha:1.0]];
self.window.titleVisibility = NSWindowTitleHidden;
currentCallVC = [[CurrentCallVC alloc] initWithNibName:@"CurrentCall" bundle:nil]; currentCallVC = [[CurrentCallVC alloc] initWithNibName:@"CurrentCall" bundle:nil];
offlineVC = [[ConversationVC alloc] initWithNibName:@"Conversation" bundle:nil]; offlineVC = [[ConversationVC alloc] initWithNibName:@"Conversation" bundle:nil];
chooseAccountVC = [[ChooseAccountVC alloc] initWithNibName:@"ChooseAccount" bundle:nil];
[callView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [callView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[[currentCallVC view] setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [[currentCallVC view] setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
[[offlineVC view] setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable]; [[offlineVC view] setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
...@@ -94,13 +98,6 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; ...@@ -94,13 +98,6 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier";
- (void) connect - (void) connect
{ {
// Update Ring ID label based on account model changes // Update Ring ID label based on account model changes
QObject::disconnect(accountUpdate);
accountUpdate = QObject::connect(&AccountModel::instance(),
&AccountModel::dataChanged,
[=] {
[self updateRingID];
});
QObject::connect(RecentModel::instance().selectionModel(), QObject::connect(RecentModel::instance().selectionModel(),
&QItemSelectionModel::currentChanged, &QItemSelectionModel::currentChanged,
[=](const QModelIndex &current, const QModelIndex &previous) { [=](const QModelIndex &current, const QModelIndex &previous) {
...@@ -137,6 +134,14 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; ...@@ -137,6 +134,14 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier";
[offlineVC animateOut]; [offlineVC animateOut];
} }
}); });
QObject::connect(AccountModel::instance().userSelectionModel(),
&QItemSelectionModel::currentChanged,
[=](const QModelIndex &current, const QModelIndex &previous) {
if(!current.isValid())
return;
[self updateRingID];
});
} }
/** /**
...@@ -150,23 +155,26 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; ...@@ -150,23 +155,26 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier";
Account* finalChoice = nullptr; Account* finalChoice = nullptr;
[ringIDLabel setStringValue:@""]; [ringIDLabel setStringValue:@""];
auto ringList = AccountModel::instance().getAccountsByProtocol(Account::Protocol::RING); finalChoice = AccountModel::instance().userChosenAccount();
for (int i = 0 ; i < ringList.size() && !registered ; ++i) {
auto account = ringList.value(i); if(finalChoice == nil) {
if (account->isEnabled()) { auto ringList = AccountModel::instance().getAccountsByProtocol(Account::Protocol::RING);
if(!enabled) { for (int i = 0 ; i < ringList.size() && !registered ; ++i) {
enabled = finalChoice = account; auto account = ringList.value(i);
} if (account->isEnabled()) {
if (account->registrationState() == Account::RegistrationState::READY) { if(!enabled) {
registered = enabled = finalChoice = account; enabled = finalChoice = account;
} }
} else { if (account->registrationState() == Account::RegistrationState::READY) {
if (!finalChoice) { registered = enabled = finalChoice = account;
finalChoice = account; }
} else {
if (!finalChoice) {
finalChoice = account;
}
} }
} }
} }
auto name = finalChoice->registeredName(); auto name = finalChoice->registeredName();
NSString* uriToDisplay = nullptr; NSString* uriToDisplay = nullptr;
if (!name.isNull() && !name.isEmpty()) { if (!name.isNull() && !name.isEmpty()) {
...@@ -319,10 +327,13 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; ...@@ -319,10 +327,13 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier";
[self migrateRingAccount:acc]; [self migrateRingAccount:acc];
} else { } else {
// Fresh run, we need to make sure RingID appears // Fresh run, we need to make sure RingID appears
[self updateRingID];
[shareButton sendActionOn:NSLeftMouseDownMask]; [shareButton sendActionOn:NSLeftMouseDownMask];
[self connect]; [self connect];
// display accounts to select
NSToolbar *toolbar = self.window.toolbar;
toolbar.delegate = self;
[toolbar insertItemWithItemIdentifier:kChangeAccountToolBarItemIdentifier atIndex:1];
} }
} }
...@@ -336,4 +347,15 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier"; ...@@ -336,4 +347,15 @@ static NSString* const kPreferencesIdentifier = @"PreferencesIdentifier";
[self checkAccountsToMigrate]; [self checkAccountsToMigrate];
} }
#pragma mark - NSToolbarDelegate
- (nullable NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag{
if(!(itemIdentifier == kChangeAccountToolBarItemIdentifier)) {
return nil;
}
NSToolbarItem *toolbarItem = [[NSToolbarItem alloc] initWithItemIdentifier:kChangeAccountToolBarItemIdentifier];
CGRect frame = chooseAccountVC.view.frame;
toolbarItem.view = chooseAccountVC.view;
return toolbarItem;
}
@end @end
/*
* Copyright (C) 2015-2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import <Cocoa/Cocoa.h>
@interface AccountMenuItemView : NSView
@property (nonatomic, strong) IBOutlet NSView* containerView;
@property (nonatomic, strong) IBOutlet NSTextField* accountLabel;
@property (nonatomic, strong) IBOutlet NSTextField* userNameLabel;
@property (nonatomic, strong) IBOutlet NSTextField* accountTypeLabel;
@property (nonatomic, strong) IBOutlet NSTextField* accountStatus;
@end
/*
* Copyright (C) 2015-2017 Savoir-faire Linux Inc.
* Author: Kateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#import "AccountMenuItemView.h"
#import "NSColor+RingTheme.h"
@implementation AccountMenuItemView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
[self loadFromNib];
}
return self;
}
- (void)loadFromNib
{
NSView *viewFromXib = nil;
NSArray *objectsFromXib = nil;
[[NSBundle mainBundle] loadNibNamed:@"AccountMenuItemView" owner:self topLevelObjects:&objectsFromXib];
for (id item in objectsFromXib) {
if ([item isKindOfClass:[NSView class]]) {
viewFromXib = item;
break;
}
}
if (viewFromXib != nil) {
self.frame = viewFromXib.frame;
self.containerView = viewFromXib;
[self addSubview:self.containerView];
}
}
- (BOOL)acceptsFirstMouse:(NSEvent *)event {
return YES;
}
-(void) mouseUp:(NSEvent *)theEvent {
NSMenu *menu = self.enclosingMenuItem.menu;
[menu cancelTracking];
[menu performActionForItemAtIndex:[menu indexOfItem:self.enclosingMenuItem]];
[super mouseUp:theEvent];
}
- (void) drawRect: (NSRect) rect {
NSMenuItem *menuItem = ([self enclosingMenuItem]);
BOOL isHighlighted = [menuItem isHighlighted];
if (isHighlighted) {
[[NSColor ringGreyHighlight] set];
[NSBezierPath fillRect:rect];
} else {
[super drawRect: rect];
}
}
@end
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D30a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<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="accountLabel" destination="V91-eS-dUh" id="MNE-TY-RqK"/>
<outlet property="accountStatus" destination="ttQ-VU-CG6" id="yqr-dK-eY0"/>
<outlet property="accountTypeLabel" destination="0PP-Di-b7L" id="O6c-L9-jBr"/>
<outlet property="containerView" destination="Hz6-mo-xeY" id="t5f-yD-zPi"/>
<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"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<textField verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="V91-eS-dUh">
<rect key="frame" x="8" y="25" width="44" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="VWk-wM-WSB"/>
</constraints>
<textFieldCell key="cell" lineBreakMode="truncatingTail" sendsActionOnEndEditing="YES" alignment="left" title="Label" id="7sc-IE-yuO">
<font key="font" metaFont="system" size="16"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="0PP-Di-b7L">
<rect key="frame" x="218" y="25" width="35" height="20"/>
<constraints>
<constraint firstAttribute="height" constant="20" id="byN-LO-mgw"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="right" title="Label" id="gOS-aC-TGo">
<font key="font" metaFont="system" size="12"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" 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 horizontalHuggingPriority="251" verticalHuggingPriority="750" allowsCharacterPickerTouchBarItem="NO" 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 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"/>
</constraints>
</customView>
</objects>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="11762" systemVersion="16D30a" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<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="ChooseAccountVC">
<connections>
<outlet property="accountSelectionButton" destination="sMr-ym-Q7q" id="aWB-iE-k1f"/>
<outlet property="profileImage" destination="JSg-rZ-Xia" id="keh-R2-VI8"/>
<outlet property="view" destination="Hz6-mo-xeY" id="0bl-1N-x8E"/>
</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="200" height="30"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
<subviews>
<box boxType="custom" borderType="none" title="Box" translatesAutoresizingMaskIntoConstraints="NO" id="Cvs-Qn-771">
<rect key="frame" x="0.0" y="0.0" width="200" height="30"/>
<view key="contentView" id="HA7-fk-gse">
<rect key="frame" x="0.0" y="0.0" width="200" height="30"/>
<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"/>
<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>
<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">
<behavior key="behavior" changeContents="YES" doesNotDimImage="YES" lightByContents="YES"/>
<font key="font" metaFont="system" size="16"/>
<menu key="menu" id="R46-PB-Vne">
<items>
<menuItem state="on" id="CTF-me-3R0">
<modifierMask key="keyEquivalentModifierMask"/>
</menuItem>
<menuItem title="Item 2" id="96g-DV-w7N"/>
<menuItem title="Item 3" id="ck4-ev-O3i"/>
</items>
</menu>
</popUpButtonCell>
<connections>
<action selector="itemChanged:" target="-2" id="mQK-JP-QcL"/>
</connections>
</popUpButton>
</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="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"/>
</constraints>
</view>
</box>
</subviews>
<constraints>
<constraint firstAttribute="bottom" secondItem="Cvs-Qn-771" secondAttribute="bottom" id="DVK-x6-u1L"/>
<constraint firstAttribute="trailing" secondItem="Cvs-Qn-771" secondAttribute="trailing" id="YNS-9b-75H"/>
<constraint firstItem="Cvs-Qn-771" firstAttribute="leading" secondItem="Hz6-mo-xeY" secondAttribute="leading" id="gyt-ki-BUX"/>
<constraint firstItem="Cvs-Qn-771" firstAttribute="top" secondItem="Hz6-mo-xeY" secondAttribute="top" id="ntP-C1-M3d"/>
</constraints>
</customView>
</objects>
</document>
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment