10 #ifndef NS_RETURNS_INNER_POINTER
11 #define NS_RETURNS_INNER_POINTER
13 #import <AppKit/AppKit.h>
19 #import "vuo-wordmark-teal-cropped.h"
34 if (
self = [super init])
41 - (void)drawRect:(NSRect)rect
43 double windowWidth =
self.bounds.size.width;
44 double windowHeight =
self.bounds.size.height;
45 bool large = windowWidth > 320;
48 [NSColor.controlBackgroundColor setFill];
50 [NSColor.clearColor setFill];
51 [NSColor.windowBackgroundColor setStroke];
52 NSBezierPath *path = [NSBezierPath bezierPathWithRect:rect];
59 NSData *logoData = [NSData dataWithBytesNoCopy:vuo_wordmark_teal_cropped_pdf
60 length:vuo_wordmark_teal_cropped_pdf_len
62 NSImage *logoImage = [[NSImage alloc] initWithData:logoData];
64 NSMutableParagraphStyle *textStyle = NSMutableParagraphStyle.defaultParagraphStyle.mutableCopy;
65 textStyle.alignment = 2;
66 NSMutableDictionary *textAttributes = [NSMutableDictionary dictionaryWithObjectsAndKeys:
67 [NSFont fontWithName:@"Helvetica Neue Light" size:(large ? 18 : 13)], NSFontAttributeName,
68 NSColor.secondaryLabelColor, NSForegroundColorAttributeName,
69 textStyle, NSParagraphStyleAttributeName,
70 @2.5, NSKernAttributeName,
74 [@"Powered by" drawInRect:NSMakeRect(0, windowHeight*5/8, windowWidth, windowHeight/4)
75 withAttributes:textAttributes];
79 double imageAspect = logoImage.size.width / logoImage.size.height;
80 double imageScale = .5;
81 [logoImage drawInRect:NSMakeRect(windowWidth/2 - windowWidth*imageScale/2,
82 windowHeight/2 - windowWidth*imageScale/imageAspect/2,
83 windowWidth*imageScale,
84 windowWidth*imageScale/imageAspect)];
88 textAttributes[NSKernAttributeName] = @0;
89 textAttributes[NSUnderlineStyleAttributeName] = @(NSUnderlineStyleSingle);
90 textAttributes[NSUnderlineColorAttributeName] = NSColor.tertiaryLabelColor;
91 [urlLabel drawInRect:NSMakeRect(0, windowHeight*-1/16, windowWidth, windowHeight/4)
92 withAttributes:textAttributes];
98 - (void)mouseDown:(NSEvent *)event
100 [[NSWorkspace sharedWorkspace] openURL:[NSURL URLWithString:(VuoShouldShowSplashWindow() ? windowURLCE : windowURL)]];
103 - (void)resetCursorRects
105 [
self addCursorRect:self.visibleRect cursor:NSCursor.pointingHandCursor];