Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //// General Declarations
- CGContextRef context = [[NSGraphicsContext currentContext] graphicsPort];
- //// Color Declarations
- NSColor* dark1 = [NSColor colorWithCalibratedRed: 0.15 green: 0.16 blue: 0.19 alpha: 1];
- NSColor* dark2 = [NSColor colorWithCalibratedRed: 0 green: 0 blue: 0 alpha: 1];
- NSColor* white = [NSColor colorWithCalibratedRed: 1 green: 1 blue: 1 alpha: 1];
- NSColor* white25 = [NSColor colorWithCalibratedHue: [white hueComponent] saturation: [white saturationComponent] brightness: 0.25 alpha: [white alphaComponent]];
- NSColor* white3 = [NSColor colorWithCalibratedHue: [white hueComponent] saturation: [white saturationComponent] brightness: 0.03 alpha: [white alphaComponent]];
- NSColor* arrowColor = [NSColor colorWithCalibratedRed: 0.76 green: 0.76 blue: 0.76 alpha: 1];
- NSColor* black = [NSColor colorWithCalibratedRed: 0 green: 0 blue: 0 alpha: 1];
- NSColor* black80 = [black colorWithAlphaComponent: 0.8];
- NSColor* lightBack = [NSColor colorWithCalibratedRed: 0.99 green: 0.98 blue: 0.96 alpha: 1];
- //// Gradient Declarations
- NSGradient* darkBackgroundRgadient = [[NSGradient alloc] initWithStartingColor: dark1 endingColor: dark2];
- //// Shadow Declarations
- NSShadow* shadow = [[NSShadow alloc] init];
- [shadow setShadowColor: white25];
- [shadow setShadowOffset: NSMakeSize(0, -1)];
- [shadow setShadowBlurRadius: 0];
- NSShadow* arrowShadow = [[NSShadow alloc] init];
- [arrowShadow setShadowColor: [NSColor blackColor]];
- [arrowShadow setShadowOffset: NSMakeSize(0, -1)];
- [arrowShadow setShadowBlurRadius: 0];
- NSShadow* innerShadow = [[NSShadow alloc] init];
- [innerShadow setShadowColor: white3];
- [innerShadow setShadowOffset: NSMakeSize(0, -1)];
- [innerShadow setShadowBlurRadius: 5];
- NSShadow* outerShadow = [[NSShadow alloc] init];
- [outerShadow setShadowColor: black80];
- [outerShadow setShadowOffset: NSMakeSize(0, -1)];
- [outerShadow setShadowBlurRadius: 2];
- //// Abstracted Graphic Attributes
- NSRect bigBack2Rect = NSMakeRect(0, 0, 305, 64);
- NSRect bigBackRect = NSMakeRect(6.5, 6.5, 293, 51);
- NSString* yearContent = "83";
- NSFont* yearFont = [NSFont fontWithName: "Helvetica-Bold" size: 27.5];
- NSString* year2Content = "19";
- NSFont* year2Font = [NSFont fontWithName: "Helvetica-Bold" size: 27.5];
- NSString* monthContent = "03";
- NSFont* monthFont = [NSFont fontWithName: "Helvetica-Bold" size: 27.5];
- NSString* dayContent = "28";
- NSFont* dayFont = [NSFont fontWithName: "Helvetica-Bold" size: 27.5];
- //// BigBack 2 Drawing
- NSBezierPath* bigBack2Path = [NSBezierPath bezierPathWithRect: bigBack2Rect];
- [lightBack setFill];
- [bigBack2Path fill];
- //// BigBack Drawing
- NSBezierPath* bigBackPath = [NSBezierPath bezierPathWithRect: bigBackRect];
- [white setFill];
- [bigBackPath fill];
- [[NSColor lightGrayColor] setStroke];
- [bigBackPath setLineWidth: 1];
- [bigBackPath stroke];
- //// DigBackYear Drawing
- NSBezierPath* digBackYearPath = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(224, 13, 43, 36) xRadius: 4 yRadius: 4];
- [NSGraphicsContext saveGraphicsState];
- [outerShadow set];
- CGContextBeginTransparencyLayer(context, NULL);
- [darkBackgroundRgadient drawInBezierPath: digBackYearPath angle: 90];
- CGContextEndTransparencyLayer(context);
- ////// DigBackYear Inner Shadow
- NSRect digBackYearBorderRect = NSInsetRect([digBackYearPath bounds], -innerShadow.shadowBlurRadius, -innerShadow.shadowBlurRadius);
- digBackYearBorderRect = NSOffsetRect(digBackYearBorderRect, -innerShadow.shadowOffset.width, innerShadow.shadowOffset.height);
- digBackYearBorderRect = NSInsetRect(NSUnionRect(digBackYearBorderRect, [digBackYearPath bounds]), -1, -1);
- NSBezierPath* digBackYearNegativePath = [NSBezierPath bezierPathWithRect: digBackYearBorderRect];
- [digBackYearNegativePath appendBezierPath: digBackYearPath];
- [digBackYearNegativePath setWindingRule: NSEvenOddWindingRule];
- [NSGraphicsContext saveGraphicsState]; {
- NSShadow* innerShadowWithOffset = [innerShadow copy];
- CGFloat xOffset = innerShadowWithOffset.shadowOffset.width + round(digBackYearBorderRect.size.width);
- CGFloat yOffset = innerShadowWithOffset.shadowOffset.height;
- innerShadowWithOffset.shadowOffset = NSMakeSize(xOffset + copysign(0.1, xOffset), yOffset + copysign(0.1, yOffset));
- [innerShadowWithOffset set];
- [[NSColor grayColor] setFill];
- [digBackYearPath addClip];
- NSAffineTransform* transform = [NSAffineTransform transform];
- [transform translateXBy: -round(digBackYearBorderRect.size.width) yBy: 0];
- [[transform transformBezierPath: digBackYearNegativePath] fill];
- }
- [NSGraphicsContext restoreGraphicsState];
- [NSGraphicsContext restoreGraphicsState];
- //// Year Drawing
- NSRect yearRect = NSMakeRect(225, 14, 42, 37);
- NSMutableParagraphStyle* yearStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
- [yearStyle setAlignment: NSCenterTextAlignment];
- NSDictionary* yearFontAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
- yearFont, NSFontAttributeName,
- white, NSForegroundColorAttributeName,
- yearStyle, NSParagraphStyleAttributeName, nil];
- [yearContent drawInRect: yearRect withAttributes: yearFontAttributes];
- //// YearLine2 Drawing
- NSBezierPath* yearLine2Path = [NSBezierPath bezierPath];
- [yearLine2Path moveToPoint: NSMakePoint(224, 29.5)];
- [yearLine2Path lineToPoint: NSMakePoint(267, 29.5)];
- [yearLine2Path setMiterLimit: 1];
- [dark2 setFill];
- [yearLine2Path fill];
- [NSGraphicsContext saveGraphicsState];
- [shadow set];
- [dark2 setStroke];
- [yearLine2Path setLineWidth: 1];
- [yearLine2Path stroke];
- [NSGraphicsContext restoreGraphicsState];
- //// UpDownBackYear Drawing
- NSBezierPath* upDownBackYearPath = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(272, 13, 20, 36) xRadius: 4 yRadius: 4];
- [NSGraphicsContext saveGraphicsState];
- [outerShadow set];
- CGContextBeginTransparencyLayer(context, NULL);
- [darkBackgroundRgadient drawInBezierPath: upDownBackYearPath angle: 90];
- CGContextEndTransparencyLayer(context);
- ////// UpDownBackYear Inner Shadow
- NSRect upDownBackYearBorderRect = NSInsetRect([upDownBackYearPath bounds], -innerShadow.shadowBlurRadius, -innerShadow.shadowBlurRadius);
- upDownBackYearBorderRect = NSOffsetRect(upDownBackYearBorderRect, -innerShadow.shadowOffset.width, innerShadow.shadowOffset.height);
- upDownBackYearBorderRect = NSInsetRect(NSUnionRect(upDownBackYearBorderRect, [upDownBackYearPath bounds]), -1, -1);
- NSBezierPath* upDownBackYearNegativePath = [NSBezierPath bezierPathWithRect: upDownBackYearBorderRect];
- [upDownBackYearNegativePath appendBezierPath: upDownBackYearPath];
- [upDownBackYearNegativePath setWindingRule: NSEvenOddWindingRule];
- [NSGraphicsContext saveGraphicsState]; {
- NSShadow* innerShadowWithOffset = [innerShadow copy];
- CGFloat xOffset = innerShadowWithOffset.shadowOffset.width + round(upDownBackYearBorderRect.size.width);
- CGFloat yOffset = innerShadowWithOffset.shadowOffset.height;
- innerShadowWithOffset.shadowOffset = NSMakeSize(xOffset + copysign(0.1, xOffset), yOffset + copysign(0.1, yOffset));
- [innerShadowWithOffset set];
- [[NSColor grayColor] setFill];
- [upDownBackYearPath addClip];
- NSAffineTransform* transform = [NSAffineTransform transform];
- [transform translateXBy: -round(upDownBackYearBorderRect.size.width) yBy: 0];
- [[transform transformBezierPath: upDownBackYearNegativePath] fill];
- }
- [NSGraphicsContext restoreGraphicsState];
- [NSGraphicsContext restoreGraphicsState];
- //// YearLine3 Drawing
- NSBezierPath* yearLine3Path = [NSBezierPath bezierPath];
- [yearLine3Path moveToPoint: NSMakePoint(272, 29.5)];
- [yearLine3Path lineToPoint: NSMakePoint(292, 29.5)];
- [yearLine3Path setMiterLimit: 1];
- [dark2 setFill];
- [yearLine3Path fill];
- [NSGraphicsContext saveGraphicsState];
- [shadow set];
- [dark2 setStroke];
- [yearLine3Path setLineWidth: 1];
- [yearLine3Path stroke];
- [NSGraphicsContext restoreGraphicsState];
- //// Up Drawing
- NSBezierPath* upPath = [NSBezierPath bezierPath];
- [upPath moveToPoint: NSMakePoint(277, 25)];
- [upPath lineToPoint: NSMakePoint(287, 25)];
- [upPath lineToPoint: NSMakePoint(282, 20)];
- [upPath lineToPoint: NSMakePoint(277, 25)];
- [upPath closePath];
- [NSGraphicsContext saveGraphicsState];
- [arrowShadow set];
- [arrowColor setFill];
- [upPath fill];
- [NSGraphicsContext restoreGraphicsState];
- //// Down Drawing
- NSBezierPath* downPath = [NSBezierPath bezierPath];
- [downPath moveToPoint: NSMakePoint(277, 37)];
- [downPath lineToPoint: NSMakePoint(287, 37)];
- [downPath lineToPoint: NSMakePoint(282, 42)];
- [downPath lineToPoint: NSMakePoint(277, 37)];
- [downPath closePath];
- [NSGraphicsContext saveGraphicsState];
- [arrowShadow set];
- [arrowColor setFill];
- [downPath fill];
- [NSGraphicsContext restoreGraphicsState];
- //// DigBackYear1 Drawing
- NSBezierPath* digBackYear1Path = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(176, 13, 43, 36) xRadius: 4 yRadius: 4];
- [NSGraphicsContext saveGraphicsState];
- [outerShadow set];
- CGContextBeginTransparencyLayer(context, NULL);
- [darkBackgroundRgadient drawInBezierPath: digBackYear1Path angle: 90];
- CGContextEndTransparencyLayer(context);
- ////// DigBackYear1 Inner Shadow
- NSRect digBackYear1BorderRect = NSInsetRect([digBackYear1Path bounds], -innerShadow.shadowBlurRadius, -innerShadow.shadowBlurRadius);
- digBackYear1BorderRect = NSOffsetRect(digBackYear1BorderRect, -innerShadow.shadowOffset.width, innerShadow.shadowOffset.height);
- digBackYear1BorderRect = NSInsetRect(NSUnionRect(digBackYear1BorderRect, [digBackYear1Path bounds]), -1, -1);
- NSBezierPath* digBackYear1NegativePath = [NSBezierPath bezierPathWithRect: digBackYear1BorderRect];
- [digBackYear1NegativePath appendBezierPath: digBackYear1Path];
- [digBackYear1NegativePath setWindingRule: NSEvenOddWindingRule];
- [NSGraphicsContext saveGraphicsState]; {
- NSShadow* innerShadowWithOffset = [innerShadow copy];
- CGFloat xOffset = innerShadowWithOffset.shadowOffset.width + round(digBackYear1BorderRect.size.width);
- CGFloat yOffset = innerShadowWithOffset.shadowOffset.height;
- innerShadowWithOffset.shadowOffset = NSMakeSize(xOffset + copysign(0.1, xOffset), yOffset + copysign(0.1, yOffset));
- [innerShadowWithOffset set];
- [[NSColor grayColor] setFill];
- [digBackYear1Path addClip];
- NSAffineTransform* transform = [NSAffineTransform transform];
- [transform translateXBy: -round(digBackYear1BorderRect.size.width) yBy: 0];
- [[transform transformBezierPath: digBackYear1NegativePath] fill];
- }
- [NSGraphicsContext restoreGraphicsState];
- [NSGraphicsContext restoreGraphicsState];
- //// year2 Drawing
- NSRect year2Rect = NSMakeRect(177, 14, 42, 37);
- NSMutableParagraphStyle* year2Style = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
- [year2Style setAlignment: NSCenterTextAlignment];
- NSDictionary* year2FontAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
- year2Font, NSFontAttributeName,
- white, NSForegroundColorAttributeName,
- year2Style, NSParagraphStyleAttributeName, nil];
- [year2Content drawInRect: year2Rect withAttributes: year2FontAttributes];
- //// YearLine Drawing
- NSBezierPath* yearLinePath = [NSBezierPath bezierPath];
- [yearLinePath moveToPoint: NSMakePoint(176, 29.5)];
- [yearLinePath lineToPoint: NSMakePoint(219, 29.5)];
- [yearLinePath setMiterLimit: 1];
- [dark2 setFill];
- [yearLinePath fill];
- [NSGraphicsContext saveGraphicsState];
- [shadow set];
- [dark2 setStroke];
- [yearLinePath setLineWidth: 1];
- [yearLinePath stroke];
- [NSGraphicsContext restoreGraphicsState];
- //// DigBackMonth Drawing
- NSBezierPath* digBackMonthPath = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(95, 13, 43, 36) xRadius: 4 yRadius: 4];
- [NSGraphicsContext saveGraphicsState];
- [outerShadow set];
- CGContextBeginTransparencyLayer(context, NULL);
- [darkBackgroundRgadient drawInBezierPath: digBackMonthPath angle: 90];
- CGContextEndTransparencyLayer(context);
- ////// DigBackMonth Inner Shadow
- NSRect digBackMonthBorderRect = NSInsetRect([digBackMonthPath bounds], -innerShadow.shadowBlurRadius, -innerShadow.shadowBlurRadius);
- digBackMonthBorderRect = NSOffsetRect(digBackMonthBorderRect, -innerShadow.shadowOffset.width, innerShadow.shadowOffset.height);
- digBackMonthBorderRect = NSInsetRect(NSUnionRect(digBackMonthBorderRect, [digBackMonthPath bounds]), -1, -1);
- NSBezierPath* digBackMonthNegativePath = [NSBezierPath bezierPathWithRect: digBackMonthBorderRect];
- [digBackMonthNegativePath appendBezierPath: digBackMonthPath];
- [digBackMonthNegativePath setWindingRule: NSEvenOddWindingRule];
- [NSGraphicsContext saveGraphicsState]; {
- NSShadow* innerShadowWithOffset = [innerShadow copy];
- CGFloat xOffset = innerShadowWithOffset.shadowOffset.width + round(digBackMonthBorderRect.size.width);
- CGFloat yOffset = innerShadowWithOffset.shadowOffset.height;
- innerShadowWithOffset.shadowOffset = NSMakeSize(xOffset + copysign(0.1, xOffset), yOffset + copysign(0.1, yOffset));
- [innerShadowWithOffset set];
- [[NSColor grayColor] setFill];
- [digBackMonthPath addClip];
- NSAffineTransform* transform = [NSAffineTransform transform];
- [transform translateXBy: -round(digBackMonthBorderRect.size.width) yBy: 0];
- [[transform transformBezierPath: digBackMonthNegativePath] fill];
- }
- [NSGraphicsContext restoreGraphicsState];
- [NSGraphicsContext restoreGraphicsState];
- //// Month Drawing
- NSRect monthRect = NSMakeRect(96, 14, 42, 37);
- NSMutableParagraphStyle* monthStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
- [monthStyle setAlignment: NSCenterTextAlignment];
- NSDictionary* monthFontAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
- monthFont, NSFontAttributeName,
- white, NSForegroundColorAttributeName,
- monthStyle, NSParagraphStyleAttributeName, nil];
- [monthContent drawInRect: monthRect withAttributes: monthFontAttributes];
- //// MonthLine Drawing
- NSBezierPath* monthLinePath = [NSBezierPath bezierPath];
- [monthLinePath moveToPoint: NSMakePoint(95, 29.5)];
- [monthLinePath lineToPoint: NSMakePoint(138, 29.5)];
- [monthLinePath setMiterLimit: 1];
- [dark2 setFill];
- [monthLinePath fill];
- [NSGraphicsContext saveGraphicsState];
- [shadow set];
- [dark2 setStroke];
- [monthLinePath setLineWidth: 1];
- [monthLinePath stroke];
- [NSGraphicsContext restoreGraphicsState];
- //// UpDownBackMonth Drawing
- NSBezierPath* upDownBackMonthPath = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(143, 13, 20, 36) xRadius: 4 yRadius: 4];
- [NSGraphicsContext saveGraphicsState];
- [outerShadow set];
- CGContextBeginTransparencyLayer(context, NULL);
- [darkBackgroundRgadient drawInBezierPath: upDownBackMonthPath angle: 90];
- CGContextEndTransparencyLayer(context);
- ////// UpDownBackMonth Inner Shadow
- NSRect upDownBackMonthBorderRect = NSInsetRect([upDownBackMonthPath bounds], -innerShadow.shadowBlurRadius, -innerShadow.shadowBlurRadius);
- upDownBackMonthBorderRect = NSOffsetRect(upDownBackMonthBorderRect, -innerShadow.shadowOffset.width, innerShadow.shadowOffset.height);
- upDownBackMonthBorderRect = NSInsetRect(NSUnionRect(upDownBackMonthBorderRect, [upDownBackMonthPath bounds]), -1, -1);
- NSBezierPath* upDownBackMonthNegativePath = [NSBezierPath bezierPathWithRect: upDownBackMonthBorderRect];
- [upDownBackMonthNegativePath appendBezierPath: upDownBackMonthPath];
- [upDownBackMonthNegativePath setWindingRule: NSEvenOddWindingRule];
- [NSGraphicsContext saveGraphicsState]; {
- NSShadow* innerShadowWithOffset = [innerShadow copy];
- CGFloat xOffset = innerShadowWithOffset.shadowOffset.width + round(upDownBackMonthBorderRect.size.width);
- CGFloat yOffset = innerShadowWithOffset.shadowOffset.height;
- innerShadowWithOffset.shadowOffset = NSMakeSize(xOffset + copysign(0.1, xOffset), yOffset + copysign(0.1, yOffset));
- [innerShadowWithOffset set];
- [[NSColor grayColor] setFill];
- [upDownBackMonthPath addClip];
- NSAffineTransform* transform = [NSAffineTransform transform];
- [transform translateXBy: -round(upDownBackMonthBorderRect.size.width) yBy: 0];
- [[transform transformBezierPath: upDownBackMonthNegativePath] fill];
- }
- [NSGraphicsContext restoreGraphicsState];
- [NSGraphicsContext restoreGraphicsState];
- //// MonthLine2 Drawing
- NSBezierPath* monthLine2Path = [NSBezierPath bezierPath];
- [monthLine2Path moveToPoint: NSMakePoint(143, 29.5)];
- [monthLine2Path lineToPoint: NSMakePoint(163, 29.5)];
- [monthLine2Path setMiterLimit: 1];
- [dark2 setFill];
- [monthLine2Path fill];
- [NSGraphicsContext saveGraphicsState];
- [shadow set];
- [dark2 setStroke];
- [monthLine2Path setLineWidth: 1];
- [monthLine2Path stroke];
- [NSGraphicsContext restoreGraphicsState];
- //// Up 2 Drawing
- NSBezierPath* up2Path = [NSBezierPath bezierPath];
- [up2Path moveToPoint: NSMakePoint(148, 25)];
- [up2Path lineToPoint: NSMakePoint(158, 25)];
- [up2Path lineToPoint: NSMakePoint(153, 20)];
- [up2Path lineToPoint: NSMakePoint(148, 25)];
- [up2Path closePath];
- [NSGraphicsContext saveGraphicsState];
- [arrowShadow set];
- [arrowColor setFill];
- [up2Path fill];
- [NSGraphicsContext restoreGraphicsState];
- //// Down 2 Drawing
- NSBezierPath* down2Path = [NSBezierPath bezierPath];
- [down2Path moveToPoint: NSMakePoint(148, 37)];
- [down2Path lineToPoint: NSMakePoint(158, 37)];
- [down2Path lineToPoint: NSMakePoint(153, 42)];
- [down2Path lineToPoint: NSMakePoint(148, 37)];
- [down2Path closePath];
- [NSGraphicsContext saveGraphicsState];
- [arrowShadow set];
- [arrowColor setFill];
- [down2Path fill];
- [NSGraphicsContext restoreGraphicsState];
- //// DigBackDay Drawing
- NSBezierPath* digBackDayPath = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(14, 13, 43, 36) xRadius: 4 yRadius: 4];
- [NSGraphicsContext saveGraphicsState];
- [outerShadow set];
- CGContextBeginTransparencyLayer(context, NULL);
- [darkBackgroundRgadient drawInBezierPath: digBackDayPath angle: 90];
- CGContextEndTransparencyLayer(context);
- ////// DigBackDay Inner Shadow
- NSRect digBackDayBorderRect = NSInsetRect([digBackDayPath bounds], -innerShadow.shadowBlurRadius, -innerShadow.shadowBlurRadius);
- digBackDayBorderRect = NSOffsetRect(digBackDayBorderRect, -innerShadow.shadowOffset.width, innerShadow.shadowOffset.height);
- digBackDayBorderRect = NSInsetRect(NSUnionRect(digBackDayBorderRect, [digBackDayPath bounds]), -1, -1);
- NSBezierPath* digBackDayNegativePath = [NSBezierPath bezierPathWithRect: digBackDayBorderRect];
- [digBackDayNegativePath appendBezierPath: digBackDayPath];
- [digBackDayNegativePath setWindingRule: NSEvenOddWindingRule];
- [NSGraphicsContext saveGraphicsState]; {
- NSShadow* innerShadowWithOffset = [innerShadow copy];
- CGFloat xOffset = innerShadowWithOffset.shadowOffset.width + round(digBackDayBorderRect.size.width);
- CGFloat yOffset = innerShadowWithOffset.shadowOffset.height;
- innerShadowWithOffset.shadowOffset = NSMakeSize(xOffset + copysign(0.1, xOffset), yOffset + copysign(0.1, yOffset));
- [innerShadowWithOffset set];
- [[NSColor grayColor] setFill];
- [digBackDayPath addClip];
- NSAffineTransform* transform = [NSAffineTransform transform];
- [transform translateXBy: -round(digBackDayBorderRect.size.width) yBy: 0];
- [[transform transformBezierPath: digBackDayNegativePath] fill];
- }
- [NSGraphicsContext restoreGraphicsState];
- [NSGraphicsContext restoreGraphicsState];
- //// day Drawing
- NSRect dayRect = NSMakeRect(15, 14, 42, 37);
- NSMutableParagraphStyle* dayStyle = [[NSMutableParagraphStyle defaultParagraphStyle] mutableCopy];
- [dayStyle setAlignment: NSCenterTextAlignment];
- NSDictionary* dayFontAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
- dayFont, NSFontAttributeName,
- white, NSForegroundColorAttributeName,
- dayStyle, NSParagraphStyleAttributeName, nil];
- [dayContent drawInRect: dayRect withAttributes: dayFontAttributes];
- //// DayLine Drawing
- NSBezierPath* dayLinePath = [NSBezierPath bezierPath];
- [dayLinePath moveToPoint: NSMakePoint(14, 29.5)];
- [dayLinePath lineToPoint: NSMakePoint(57, 29.5)];
- [dayLinePath setMiterLimit: 1];
- [dark2 setFill];
- [dayLinePath fill];
- [NSGraphicsContext saveGraphicsState];
- [shadow set];
- [dark2 setStroke];
- [dayLinePath setLineWidth: 1];
- [dayLinePath stroke];
- [NSGraphicsContext restoreGraphicsState];
- //// UpDownBackDay Drawing
- NSBezierPath* upDownBackDayPath = [NSBezierPath bezierPathWithRoundedRect: NSMakeRect(62, 13, 20, 36) xRadius: 4 yRadius: 4];
- [NSGraphicsContext saveGraphicsState];
- [outerShadow set];
- CGContextBeginTransparencyLayer(context, NULL);
- [darkBackgroundRgadient drawInBezierPath: upDownBackDayPath angle: 90];
- CGContextEndTransparencyLayer(context);
- ////// UpDownBackDay Inner Shadow
- NSRect upDownBackDayBorderRect = NSInsetRect([upDownBackDayPath bounds], -innerShadow.shadowBlurRadius, -innerShadow.shadowBlurRadius);
- upDownBackDayBorderRect = NSOffsetRect(upDownBackDayBorderRect, -innerShadow.shadowOffset.width, innerShadow.shadowOffset.height);
- upDownBackDayBorderRect = NSInsetRect(NSUnionRect(upDownBackDayBorderRect, [upDownBackDayPath bounds]), -1, -1);
- NSBezierPath* upDownBackDayNegativePath = [NSBezierPath bezierPathWithRect: upDownBackDayBorderRect];
- [upDownBackDayNegativePath appendBezierPath: upDownBackDayPath];
- [upDownBackDayNegativePath setWindingRule: NSEvenOddWindingRule];
- [NSGraphicsContext saveGraphicsState]; {
- NSShadow* innerShadowWithOffset = [innerShadow copy];
- CGFloat xOffset = innerShadowWithOffset.shadowOffset.width + round(upDownBackDayBorderRect.size.width);
- CGFloat yOffset = innerShadowWithOffset.shadowOffset.height;
- innerShadowWithOffset.shadowOffset = NSMakeSize(xOffset + copysign(0.1, xOffset), yOffset + copysign(0.1, yOffset));
- [innerShadowWithOffset set];
- [[NSColor grayColor] setFill];
- [upDownBackDayPath addClip];
- NSAffineTransform* transform = [NSAffineTransform transform];
- [transform translateXBy: -round(upDownBackDayBorderRect.size.width) yBy: 0];
- [[transform transformBezierPath: upDownBackDayNegativePath] fill];
- }
- [NSGraphicsContext restoreGraphicsState];
- [NSGraphicsContext restoreGraphicsState];
- //// DayLine2 Drawing
- NSBezierPath* dayLine2Path = [NSBezierPath bezierPath];
- [dayLine2Path moveToPoint: NSMakePoint(62, 29.5)];
- [dayLine2Path lineToPoint: NSMakePoint(82, 29.5)];
- [dayLine2Path setMiterLimit: 1];
- [dark2 setFill];
- [dayLine2Path fill];
- [NSGraphicsContext saveGraphicsState];
- [shadow set];
- [dark2 setStroke];
- [dayLine2Path setLineWidth: 1];
- [dayLine2Path stroke];
- [NSGraphicsContext restoreGraphicsState];
- //// Up 3 Drawing
- NSBezierPath* up3Path = [NSBezierPath bezierPath];
- [up3Path moveToPoint: NSMakePoint(67, 25)];
- [up3Path lineToPoint: NSMakePoint(77, 25)];
- [up3Path lineToPoint: NSMakePoint(72, 20)];
- [up3Path lineToPoint: NSMakePoint(67, 25)];
- [up3Path closePath];
- [NSGraphicsContext saveGraphicsState];
- [arrowShadow set];
- [arrowColor setFill];
- [up3Path fill];
- [NSGraphicsContext restoreGraphicsState];
- //// Down 3 Drawing
- NSBezierPath* down3Path = [NSBezierPath bezierPath];
- [down3Path moveToPoint: NSMakePoint(67, 37)];
- [down3Path lineToPoint: NSMakePoint(77, 37)];
- [down3Path lineToPoint: NSMakePoint(72, 42)];
- [down3Path lineToPoint: NSMakePoint(67, 37)];
- [down3Path closePath];
- [NSGraphicsContext saveGraphicsState];
- [arrowShadow set];
- [arrowColor setFill];
- [down3Path fill];
- [NSGraphicsContext restoreGraphicsState];
Add Comment
Please, Sign In to add comment