Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 7bc3a97e38
Fetching contributors…

Cannot retrieve contributors at this time

64 lines (47 sloc) 1.745 kb
#import "SpectacleWindowActionController.h"
#import "SpectacleWindowPositionManager.h"
#import "SpectacleHotKeyManager.h"
#import "SpectacleUtilities.h"
@implementation SpectacleWindowActionController
- (id)init
{
if(self = [super init]) {
myWindowPositionManager = [SpectacleWindowPositionManager sharedManager];
myHotKeyManager = [SpectacleHotKeyManager sharedManager];
}
return self;
}
#pragma mark -
- (void)registerHotKeys
{
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
NSMutableDictionary *hotKeysFromUserDefaults = [NSMutableDictionary dictionary];
for(NSString *hotKeyName in [SpectacleUtilities hotKeyNames]) {
hotKeysFromUserDefaults[hotKeyName] = [userDefaults dataForKey:hotKeyName];
}
[myHotKeyManager registerHotKeys:[SpectacleUtilities hotKeysFromDictionary:hotKeysFromUserDefaults hotKeyTarget:self]];
}
#pragma mark -
- (IBAction)moveFrontMostWindowToFullscreen:(id)sender
{
[myWindowPositionManager moveFrontMostWindowWithAction:SpectacleWindowActionFullscreen];
}
#pragma mark -
- (IBAction)moveFrontMostWindowToLeftHalf:(id)sender
{
[myWindowPositionManager moveFrontMostWindowWithAction:SpectacleWindowActionLeftHalf];
}
- (IBAction)moveFrontMostWindowToRightHalf:(id)sender
{
[myWindowPositionManager moveFrontMostWindowWithAction:SpectacleWindowActionRightHalf];
}
#pragma mark -
- (IBAction)moveFrontMostWindowToNextDisplay:(id)sender
{
[myWindowPositionManager moveFrontMostWindowWithAction:SpectacleWindowActionNextDisplay];
}
- (IBAction)moveFrontMostWindowToPreviousDisplay:(id)sender
{
[myWindowPositionManager moveFrontMostWindowWithAction:SpectacleWindowActionPreviousDisplay];
}
@end
Jump to Line
Something went wrong with that request. Please try again.