Created
April 11, 2016 16:04
-
-
Save scottcorgan/dddca262dcc101292ee68e3e0a6e3f92 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// Need to dock compensation because the width is not accurate | |
// when dock is hidden | |
var HIDDEN_DOCK_COMPENSATION = 4 | |
var halfRight = slate.operation('push', { | |
direction: 'right', | |
style: 'bar-resize:screenSizeX / 2' | |
}) | |
var halfLeft = slate.operation('move', { | |
x : 'screenOriginX - ' + HIDDEN_DOCK_COMPENSATION, | |
y : 'screenOriginY', | |
width : '(screenSizeX / 2) + ' + HIDDEN_DOCK_COMPENSATION, | |
height : 'screenSizeY' | |
}) | |
var maximize = slate.operation('move', { | |
x : 'screenOriginX - ' + HIDDEN_DOCK_COMPENSATION, | |
y : 'screenOriginY', | |
width : 'screenSizeX + ' + HIDDEN_DOCK_COMPENSATION, | |
height : 'screenSizeY' | |
}) | |
var center = slate.operation('move', { | |
x : 'screenSizeX/10', | |
y : 'screenSizeY/10', | |
width : 'screenSizeX - (screenSizeX/10) * 2', | |
height : 'screenSizeY - (screenSizeY/10) * 2' | |
}) | |
slate.bind('right:ctrl,alt,cmd', function (win) { | |
win.doOperation(halfRight) | |
}) | |
slate.bind('left:ctrl,alt,cmd', function (win) { | |
win.doOperation(halfLeft) | |
}) | |
slate.bind('f:cmd,alt', function (win) { | |
win.doOperation(maximize) | |
}) | |
slate.bind('c:cmd,alt,ctrl', function (win) { | |
win.doOperation(center) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment