This repository has been archived by the owner on May 2, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#20 use NSTextField instead of NSTextView
- add QMBorderedView - fix test - add settings[XYZ]
- Loading branch information
Tae Won Ha
committed
Jan 12, 2014
1 parent
9b1bd6e
commit 630459b
Showing
11 changed files
with
1,262 additions
and
1,231 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
53 changes: 0 additions & 53 deletions
53
Qmind.xcodeproj/xcshareddata/xcschemes/QmindSenTesting.xcscheme
This file was deleted.
Oops, something went wrong.
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
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,17 @@ | ||
/** | ||
* Tae Won Ha — @hataewon | ||
* | ||
* http://taewon.de | ||
* http://qvacua.com | ||
* | ||
* See LICENSE | ||
*/ | ||
|
||
#import <Cocoa/Cocoa.h> | ||
|
||
|
||
@interface QMBorderedView : NSView | ||
|
||
@property CGFloat borderWidth; | ||
|
||
@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,60 @@ | ||
/** | ||
* Tae Won Ha — @hataewon | ||
* | ||
* http://taewon.de | ||
* http://qvacua.com | ||
* | ||
* See LICENSE | ||
*/ | ||
|
||
#import "QMBorderedView.h" | ||
#import <Qkit/Qkit.h> | ||
|
||
|
||
@interface QMBorderedView () | ||
|
||
@property NSBezierPath *borderPath; | ||
|
||
@end | ||
|
||
@implementation QMBorderedView | ||
|
||
#pragma mark NSView | ||
- (void)setFrame:(NSRect)frameRect { | ||
self.borderPath = [NSBezierPath bezierPathWithRect:NewRectWithSize(0, 0, frameRect.size)]; | ||
self.borderPath.lineWidth = self.borderWidth; | ||
|
||
[super setFrame:frameRect]; | ||
} | ||
|
||
- (void)drawRect:(NSRect)dirtyRect { | ||
[NSGraphicsContext saveGraphicsState]; | ||
{ | ||
[[NSColor grayColor] setStroke]; | ||
[[NSColor whiteColor] setFill]; | ||
|
||
[self.borderPath fill]; | ||
[self.borderPath stroke]; | ||
} | ||
[NSGraphicsContext restoreGraphicsState]; | ||
|
||
[super drawRect:dirtyRect]; | ||
} | ||
|
||
- (id)initWithFrame:(NSRect)frameRect { | ||
self = [super initWithFrame:frameRect]; | ||
if (self) { | ||
_borderWidth = 1; | ||
|
||
_borderPath = [NSBezierPath bezierPathWithRect:frameRect]; | ||
_borderPath.lineWidth = _borderWidth; | ||
} | ||
|
||
return self; | ||
} | ||
|
||
- (BOOL)isFlipped { | ||
return YES; | ||
} | ||
|
||
@end |
Oops, something went wrong.