1//
2//  PXSourceListTableCellView.m
3//  PXSourceList
4//
5//  Created by Alex Rozanski on 31/12/2013.
6//  Copyright 2009-14 Alex Rozanski http://alexrozanski.com and other contributors.
7//  This software is licensed under the New BSD License. Full details can be found in the README.
8//
9
10#import "PXSourceListTableCellView.h"
11#import "PXSourceListBadgeView.h"
12
13@implementation PXSourceListTableCellView
14
15- (void)layout
16{
17    [super layout];
18
19    if (!self.badgeView)
20        return;
21
22    [self.badgeView sizeToFit];
23
24    NSRect bounds = self.bounds;
25    NSSize badgeSize = self.badgeView.frame.size;
26    self.badgeView.frame = NSMakeRect(NSMaxX(bounds) - badgeSize.width,
27                                      NSMidY(bounds) - round(badgeSize.height / 2.0f),
28                                      badgeSize.width, badgeSize.height);
29}
30
31@end
32