Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Commit

Permalink
Add bezelwidth option to default visualizer
Browse files Browse the repository at this point in the history
  • Loading branch information
Park Hyunwoo committed Jun 19, 2014
1 parent 98b9fd8 commit ddf8ed8
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 23 deletions.
8 changes: 5 additions & 3 deletions KCDefaultVisualizer.m
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@

#import "KCKeystrokeTransformer.h"


@implementation KCDefaultVisualizerFactory

-(NSString*) visualizerNibName
Expand Down Expand Up @@ -80,7 +81,7 @@ -(void) _createVisualizerWindow
{
if (visualizerWindow == nil)
{
NSRect frameRect = NSMakeRect(0,100,200,100);
NSRect frameRect = NSMakeRect(0,100,1600,100);
visualizerWindow = [[[KCDefaultVisualizerWindow alloc]
initWithContentRect:frameRect
styleMask:NSBorderlessWindowMask
Expand Down Expand Up @@ -147,7 +148,7 @@ -(id) initWithContentRect:(NSRect)contentRect styleMask:(NSUInteger)aStyle backi
NSScreen *screen = [NSScreen mainScreen];
NSRect screenFrame = [screen frame];

NSRect frame = NSMakeRect(screenFrame.size.width-210, 10, contentRect.size.width, contentRect.size.height);
NSRect frame = NSMakeRect(screenFrame.size.width-contentRect.size.width-10, 10, contentRect.size.width, contentRect.size.height);

[self setFrame:frame display:NO];
[self setFrameUsingName:@"KCBezelWindow default.bezelWindow"];
Expand Down Expand Up @@ -200,7 +201,8 @@ -(void) addKeystroke:(KCKeystroke*)keystroke
{
NSUserDefaults* userDefaults = [NSUserDefaults standardUserDefaults];
NSRect frame = [self frame];
CGFloat maxWidth = frame.size.width;
CGFloat maxWidth = [[NSUserDefaults standardUserDefaults] floatForKey:@"default.bezelWidth"];

if (!(maxWidth > 0)) {
NSLog(@"Fixing frame; width not greater than 0: %@", NSStringFromRect(frame));
maxWidth = 200;
Expand Down
78 changes: 58 additions & 20 deletions KCDefaultVisualizer.nib/designable.nib

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified KCDefaultVisualizer.nib/keyedobjects.nib
Binary file not shown.

0 comments on commit ddf8ed8

Please sign in to comment.