Commit 2efc5a92 authored by Kateryna Kostiuk's avatar Kateryna Kostiuk Committed by Andreas Traczyk

UI: unread messages and presence indicator

Fix appearance of unread messages and presence indicator.

Change-Id: Ieecb5e9bab8c497b15cd187b435257a5d78bdad0
Reviewed-by: Andreas Traczyk's avatarAndreas Traczyk <andreas.traczyk@savoirfairelinux.com>
parent fcad7763
......@@ -57,7 +57,7 @@
[backgroundColor setFill];
[ovalPath fill];
[borderColor setStroke];
[ovalPath setLineWidth: 0.5];
[ovalPath setLineWidth: 1.0];
[ovalPath stroke];
NSDictionary *att = nil;
......@@ -65,11 +65,27 @@
[[NSParagraphStyle defaultParagraphStyle] mutableCopy];
[style setLineBreakMode:NSLineBreakByWordWrapping];
[style setAlignment:NSCenterTextAlignment];
NSFont *font = [NSFont systemFontOfSize:10.0];
if (self.stringValue.length > 1) {
font = [NSFont systemFontOfSize:8.0];
}
if (self.stringValue.length > 2) {
font = [NSFont systemFontOfSize:6.0];
}
att = [[NSDictionary alloc] initWithObjectsAndKeys:
font,NSFontAttributeName,
style, NSParagraphStyleAttributeName,
[self textColor],
NSForegroundColorAttributeName, nil];
[[self stringValue] drawInRect:dirtyRect withAttributes:att];
NSAttributedString *attrString =
[[NSAttributedString alloc] initWithString:[self stringValue]
attributes:att];
CGFloat stringHeight = attrString.size.height;
CGFloat originY = (group.size.height - stringHeight) / 2;
NSRect titleRect = CGRectMake(group.origin.x, originY, group.size.width, group.size.height);
[[self stringValue] drawInRect:titleRect withAttributes:att];
}
@end
......@@ -2,7 +2,6 @@
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="13771" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="13771"/>
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
......@@ -27,7 +26,7 @@
<windowCollectionBehavior key="collectionBehavior" fullScreenPrimary="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="196" y="240" width="1053" height="658"/>
<rect key="screenRect" x="0.0" y="0.0" width="1920" height="1200"/>
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
<view key="contentView" autoresizesSubviews="NO" id="se5-gp-TjO">
<rect key="frame" x="0.0" y="0.0" width="1053" height="658"/>
<autoresizingMask key="autoresizingMask"/>
......@@ -93,13 +92,14 @@
</constraints>
<imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSUser" id="bqQ-Jp-DPH"/>
</imageView>
<textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="500" allowsCharacterPickerTouchBarItem="YES" translatesAutoresizingMaskIntoConstraints="NO" id="MYe-rn-qOP" userLabel="UnreadMsgCount" customClass="RoundedTextField">
<rect key="frame" x="295" y="11" width="21" height="14"/>
<textField hidden="YES" horizontalHuggingPriority="251" verticalHuggingPriority="750" tag="500" allowsCharacterPickerTouchBarItem="YES" preferredMaxLayoutWidth="14" translatesAutoresizingMaskIntoConstraints="NO" id="MYe-rn-qOP" userLabel="UnreadMsgCount" customClass="RoundedTextField">
<rect key="frame" x="41" y="40" width="10" height="14"/>
<constraints>
<constraint firstAttribute="width" relation="greaterThanOrEqual" secondItem="MYe-rn-qOP" secondAttribute="height" multiplier="3/2" priority="750" id="2hf-oz-IbF"/>
<constraint firstAttribute="width" constant="10" id="NvA-xu-fEB"/>
<constraint firstAttribute="height" constant="14" id="UmR-aF-Y7V"/>
</constraints>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" placeholderString="n" drawsBackground="YES" id="sGB-x7-gig">
<font key="font" metaFont="smallSystem"/>
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" alignment="center" drawsBackground="YES" id="sGB-x7-gig">
<font key="font" metaFont="system" size="7"/>
<color key="textColor" name="controlBackgroundColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" red="0.98431372549019602" green="0.28627450980392155" blue="0.28235294117647058" alpha="0.90000000000000002" colorSpace="calibratedRGB"/>
</textFieldCell>
......@@ -121,10 +121,10 @@
</textFieldCell>
</textField>
<textField horizontalHuggingPriority="750" verticalHuggingPriority="750" tag="800" translatesAutoresizingMaskIntoConstraints="NO" id="YkV-D4-ddd" userLabel="PresenceIndicator" customClass="RoundedTextField">
<rect key="frame" x="39" y="6" width="14" height="14"/>
<rect key="frame" x="38" y="8" width="10" height="10"/>
<constraints>
<constraint firstAttribute="width" constant="10" id="IdR-WT-Pvg"/>
<constraint firstAttribute="height" constant="14" id="dO4-wg-jEC"/>
<constraint firstAttribute="width" constant="6" id="IdR-WT-Pvg"/>
<constraint firstAttribute="height" constant="10" id="dO4-wg-jEC"/>
</constraints>
<textFieldCell key="cell" enabled="NO" sendsActionOnEndEditing="YES" alignment="center" id="1DZ-7a-3Qp">
<font key="font" metaFont="system"/>
......@@ -133,7 +133,10 @@
</textFieldCell>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="color" keyPath="bgColor">
<color key="value" red="0.61246744791666663" green="0.85419379340277779" blue="0.37386067708333331" alpha="1" colorSpace="calibratedRGB"/>
<color key="value" red="0.28526475694444442" green="0.63321940104166663" blue="0.16254340277777779" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
<userDefinedRuntimeAttribute type="color" keyPath="borderColor">
<color key="value" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</textField>
......@@ -173,18 +176,18 @@
<constraint firstItem="epa-Ih-aKF" firstAttribute="top" secondItem="Z6G-mQ-L3J" secondAttribute="top" constant="3" id="34y-lV-vl2"/>
<constraint firstItem="sHH-wj-oHs" firstAttribute="leading" secondItem="Z6G-mQ-L3J" secondAttribute="leading" constant="3" id="CGt-hN-ulS"/>
<constraint firstItem="bZ6-1S-zx2" firstAttribute="leading" secondItem="epa-Ih-aKF" secondAttribute="leading" id="Ffs-rJ-b8V"/>
<constraint firstItem="YkV-D4-ddd" firstAttribute="trailing" secondItem="sHH-wj-oHs" secondAttribute="trailing" id="HSa-sm-3vp"/>
<constraint firstItem="bZ6-1S-zx2" firstAttribute="bottom" secondItem="MYe-rn-qOP" secondAttribute="bottom" id="Jbg-Rb-S74"/>
<constraint firstItem="YkV-D4-ddd" firstAttribute="trailing" secondItem="sHH-wj-oHs" secondAttribute="trailing" constant="-5" id="HSa-sm-3vp"/>
<constraint firstItem="sHH-wj-oHs" firstAttribute="top" secondItem="Z6G-mQ-L3J" secondAttribute="top" constant="6" id="KMX-Ru-AEa"/>
<constraint firstItem="MYe-rn-qOP" firstAttribute="top" secondItem="sHH-wj-oHs" secondAttribute="top" id="Kub-qp-hhR"/>
<constraint firstItem="epi-ZP-as5" firstAttribute="centerY" secondItem="epa-Ih-aKF" secondAttribute="centerY" id="L49-TZ-Pju"/>
<constraint firstItem="MYe-rn-qOP" firstAttribute="trailing" secondItem="sHH-wj-oHs" secondAttribute="trailing" id="Mv6-W1-pJW"/>
<constraint firstItem="epi-ZP-as5" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="bZ6-1S-zx2" secondAttribute="trailing" constant="10" id="N03-9f-gVt"/>
<constraint firstItem="bZ6-1S-zx2" firstAttribute="top" secondItem="epa-Ih-aKF" secondAttribute="bottom" constant="3" id="NnZ-fX-wbG"/>
<constraint firstAttribute="bottom" secondItem="sHH-wj-oHs" secondAttribute="bottom" constant="6" id="SJ6-9t-r0l"/>
<constraint firstItem="YkV-D4-ddd" firstAttribute="bottom" secondItem="sHH-wj-oHs" secondAttribute="bottom" id="TGB-Iw-hdK"/>
<constraint firstItem="YkV-D4-ddd" firstAttribute="bottom" secondItem="sHH-wj-oHs" secondAttribute="bottom" constant="-2" id="TGB-Iw-hdK"/>
<constraint firstAttribute="trailing" secondItem="epi-ZP-as5" secondAttribute="trailing" constant="5" id="XEf-2m-loK"/>
<constraint firstAttribute="trailing" secondItem="DAd-lc-L62" secondAttribute="trailing" constant="3" id="jOb-x2-6OF"/>
<constraint firstItem="epa-Ih-aKF" firstAttribute="leading" secondItem="sHH-wj-oHs" secondAttribute="trailing" constant="8" symbolic="YES" id="sdS-XG-xRu"/>
<constraint firstAttribute="trailing" secondItem="MYe-rn-qOP" secondAttribute="trailing" constant="5" id="yFn-ZR-eEJ"/>
<constraint firstItem="DAd-lc-L62" firstAttribute="centerY" secondItem="Z6G-mQ-L3J" secondAttribute="centerY" id="zYF-8x-jeD"/>
</constraints>
<connections>
......@@ -289,7 +292,7 @@
<constraints>
<constraint firstAttribute="height" constant="18" id="OFJ-Ud-WD3"/>
</constraints>
<segmentedCell key="cell" borderStyle="border" alignment="left" segmentDistribution="fillEqually" style="roundRect" trackingMode="selectOne" id="6T7-ip-Pun">
<segmentedCell key="cell" borderStyle="border" alignment="left" style="roundRect" trackingMode="selectOne" id="6T7-ip-Pun">
<font key="font" metaFont="cellTitle"/>
<segments>
<segment label="Conversations" selected="YES"/>
......
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