11 #import <AppKit/AppKit.h>
17 #import "vuo-wordmark-teal-cropped.h"
32 if (
self = [super init])
39 - (void)drawRect:(NSRect)rect
41 double windowWidth =
self.bounds.size.width;
42 double windowHeight =
self.bounds.size.height;
43 bool large = windowWidth > 320;
46 [NSColor.controlBackgroundColor setFill];
48 [NSColor.clearColor setFill];
49 [NSColor.windowBackgroundColor setStroke];
50 NSBezierPath *path = [NSBezierPath bezierPathWithRect:rect];
57 NSData *logoData = [NSData dataWithBytesNoCopy:vuo_wordmark_teal_cropped_pdf
58 length:vuo_wordmark_teal_cropped_pdf_len
60 NSImage *logoImage = [[NSImage alloc] initWithData:logoData];
62 NSMutableParagraphStyle *textStyle = NSMutableParagraphStyle.defaultParagraphStyle.mutableCopy;
63 textStyle.alignment = NSTextAlignmentCenter;
64 NSMutableDictionary *textAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:
65 [NSFont fontWithName:@"Helvetica Neue Light" size:(large ? 18 : 13)], NSFontAttributeName,
66 NSColor.secondaryLabelColor, NSForegroundColorAttributeName,
67 textStyle, NSParagraphStyleAttributeName,
68 @2.5, NSKernAttributeName,
72 [@"Powered by" drawInRect:NSMakeRect(0, windowHeight*5/8, windowWidth, windowHeight/4)
73 withAttributes:textAttributes];
77 double imageAspect = logoImage.size.width / logoImage.size.height;
78 double imageScale = .5;
79 [logoImage drawInRect:NSMakeRect(windowWidth/2 - windowWidth*imageScale/2,
80 windowHeight/2 - windowWidth*imageScale/imageAspect/2,
81 windowWidth*imageScale,
82 windowWidth*imageScale/imageAspect)];
86 textAttributes[NSKernAttributeName] = @0;
87 textAttributes[NSUnderlineStyleAttributeName] = @(NSUnderlineStyleSingle);
88 textAttributes[NSUnderlineColorAttributeName] = NSColor.tertiaryLabelColor;
89 [urlLabel drawInRect:NSMakeRect(0, windowHeight*-1/16, windowWidth, windowHeight/4)
90 withAttributes:textAttributes];
96 - (void)mouseDown:(NSEvent *)event
98 [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:(VuoShouldShowSplashWindow() ? windowURLCE : windowURL)]];
101 - (void)resetCursorRects
103 [
self addCursorRect:self.visibleRect cursor:NSCursor.pointingHandCursor];