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
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