File: GBDeleteButtonCell.m

package info (click to toggle)
sameboy 1.0.2%2Bds-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 10,632 kB
  • sloc: ansic: 29,954; objc: 22,249; asm: 1,424; pascal: 1,373; makefile: 1,064; xml: 111
file content (30 lines) | stat: -rw-r--r-- 837 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#import "GBDeleteButtonCell.h"

@implementation GBDeleteButtonCell

// Image scaling is broken on some older macOS versions
- (void)drawImage:(NSImage *)image withFrame:(NSRect)frame inView:(NSView *)controlView
{
    double size = 13;
    unsigned offset = 1;
    if (@available(macOS 10.10, *)) {
        size = 15;
        offset = 0;
    }
    frame.origin.x += round((frame.size.width - size) / 2) + offset;
    frame.origin.y += round((frame.size.height - size) / 2) - offset;
    frame.size.width = frame.size.height = size;
    [super drawImage:image withFrame:frame inView:controlView];
}

- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
    [self drawImage:self.image withFrame:cellFrame inView:controlView];
}

-(void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView
{
    
}

@end