Skip to content

Commit

Permalink
Replace asset catalog with code
Browse files Browse the repository at this point in the history
  • Loading branch information
sfsam committed Feb 14, 2021
1 parent 3670ec0 commit e494655
Show file tree
Hide file tree
Showing 29 changed files with 94 additions and 299 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
40 changes: 0 additions & 40 deletions src/MacVim/Assets.xcassets/AddTabButton.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
40 changes: 0 additions & 40 deletions src/MacVim/Assets.xcassets/CloseTabButton.imageset/Contents.json

This file was deleted.

6 changes: 0 additions & 6 deletions src/MacVim/Assets.xcassets/Contents.json

This file was deleted.

40 changes: 0 additions & 40 deletions src/MacVim/Assets.xcassets/ScrollLeftButton.imageset/Contents.json

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

This file was deleted.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
38 changes: 0 additions & 38 deletions src/MacVim/Assets.xcassets/Tabline.colorset/Contents.json

This file was deleted.

38 changes: 0 additions & 38 deletions src/MacVim/Assets.xcassets/TablineFill.colorset/Contents.json

This file was deleted.

38 changes: 0 additions & 38 deletions src/MacVim/Assets.xcassets/TablineSel.colorset/Contents.json

This file was deleted.

4 changes: 3 additions & 1 deletion src/MacVim/MMTabline/MMHoverButton.h
Expand Up @@ -4,6 +4,8 @@

@interface MMHoverButton : NSButton

@property (nonatomic) NSColor *fgColor;
@property (nonatomic, retain) NSColor *fgColor;

+ (NSImage *)imageNamed:(NSString *)name;

@end
37 changes: 37 additions & 0 deletions src/MacVim/MMTabline/MMHoverButton.m
Expand Up @@ -6,6 +6,43 @@ @implementation MMHoverButton
NSBox *_circle;
}

+ (NSImage *)imageNamed:(NSString *)name
{
CGFloat size = [name isEqualToString:@"CloseTabButton"] ? 15 : 17;
return [NSImage imageWithSize:NSMakeSize(size, size) flipped:NO drawingHandler:^BOOL(NSRect dstRect) {
NSBezierPath *p = [NSBezierPath new];
if ([name isEqualToString:@"AddTabButton"]) {
[p moveToPoint:NSMakePoint( 8.5, 4.5)];
[p lineToPoint:NSMakePoint( 8.5, 12.5)];
[p moveToPoint:NSMakePoint( 4.5, 8.5)];
[p lineToPoint:NSMakePoint(12.5, 8.5)];
[p setLineWidth:1.2];
[p stroke];
}
else if ([name isEqualToString:@"CloseTabButton"]) {
[p moveToPoint:NSMakePoint( 4.5, 4.5)];
[p lineToPoint:NSMakePoint(10.5, 10.5)];
[p moveToPoint:NSMakePoint( 4.5, 10.5)];
[p lineToPoint:NSMakePoint(10.5, 4.5)];
[p setLineWidth:1.2];
[p stroke];
}
else if ([name isEqualToString:@"ScrollLeftButton"]) {
[p moveToPoint:NSMakePoint( 5.0, 8.5)];
[p lineToPoint:NSMakePoint(10.0, 4.5)];
[p lineToPoint:NSMakePoint(10.0, 12.5)];
[p fill];
}
else if ([name isEqualToString:@"ScrollRightButton"]) {
[p moveToPoint:NSMakePoint(12.0, 8.5)];
[p lineToPoint:NSMakePoint( 7.0, 4.5)];
[p lineToPoint:NSMakePoint( 7.0, 12.5)];
[p fill];
}
return YES;
}];
}

- (instancetype)initWithFrame:(NSRect)frameRect
{
self = [super initWithFrame:frameRect];
Expand Down

0 comments on commit e494655

Please sign in to comment.