Commit 48079dec authored by Anthony Léonard's avatar Anthony Léonard Committed by Olivier SOLDANO

fix account selector behaviour

- Profile picture is hidden as it is not working properly. It will be
  fixed in a future patch.
- Menu is disabled when only one account is present on the machine as
  displaying a list with only one element is not relevant.

Change-Id: I351b42aabc99a0fb3ba07b170fa091498a4e4ca3
Reviewed-by: default avatarOlivier Soldano <olivier.soldano@savoirfairelinux.com>
parent ccb9d427
......@@ -140,6 +140,11 @@ NSMenuItem* selectedMenuItem;
break;
}
bool isAccountAlone = accList.size() == 1;
[[accountSelectionButton cell] setArrowPosition: (isAccountAlone)?NSPopUpNoArrow:NSPopUpArrowAtBottom];
[accountSelectionButton setEnabled:!isAccountAlone];
[menuBarItem setView:itemView];
[accountsMenu addItem:menuBarItem];
[accountsMenu addItem:[NSMenuItem separatorItem]];
......
<?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">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<development version="7000" identifier="xcode"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11762"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
<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">
......@@ -25,7 +25,7 @@
<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">
<imageView hidden="YES" 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"/>
......
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