This repository has been archived by the owner on Sep 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bf396aa
commit 598d08e
Showing
15 changed files
with
478 additions
and
175 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// Created by Steven Degutis | ||
// Copyright (c) 2013 Steven Degutis. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
@interface SDHowToRoundedImageView : NSImageView | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// | ||
// Created by Steven Degutis | ||
// Copyright (c) 2013 Steven Degutis. All rights reserved. | ||
// | ||
|
||
#import "SDHowToRoundedImageView.h" | ||
|
||
|
||
@implementation SDHowToRoundedImageView | ||
|
||
- (void) drawRect:(NSRect)dirtyRect { | ||
float r = 7.0; | ||
float r2 = r - 0.9; | ||
|
||
NSRect bounds = [self bounds]; | ||
NSRect imageClipBounds = NSInsetRect(bounds, 1.0, 1.0); | ||
|
||
NSBezierPath *borderFillPath = [NSBezierPath bezierPathWithRoundedRect:bounds xRadius:r yRadius:r]; | ||
NSBezierPath *imageClipPath = [NSBezierPath bezierPathWithRoundedRect:imageClipBounds xRadius:r2 yRadius:r2]; | ||
|
||
// draw border | ||
[[NSColor colorWithCalibratedWhite:0.20 alpha:1.0] setFill]; | ||
[borderFillPath fill]; | ||
|
||
// clip | ||
[imageClipPath addClip]; | ||
|
||
// draw image | ||
[super drawRect:dirtyRect]; | ||
} | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// | ||
// Created by Steven Degutis | ||
// Copyright (c) 2013 Steven Degutis. All rights reserved. | ||
// | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
@interface SDHowToWindow : NSWindow | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// Created by Steven Degutis | ||
// Copyright (c) 2013 Steven Degutis. All rights reserved. | ||
// | ||
|
||
#import "SDHowToWindow.h" | ||
|
||
|
||
@implementation SDHowToWindow | ||
|
||
- (void) swipeWithEvent:(NSEvent*)event { | ||
NSInteger dir = (NSInteger)[event deltaX]; | ||
if (dir > 0) | ||
[self tryToPerform:@selector(navigateInDirection:) with:[NSNumber numberWithInt:(-1)]]; | ||
if (dir < 0) | ||
[self tryToPerform:@selector(navigateInDirection:) with:[NSNumber numberWithInt:(+1)]]; | ||
} | ||
|
||
@end |
Oops, something went wrong.