-
Notifications
You must be signed in to change notification settings - Fork 2
/
constants.js
89 lines (86 loc) · 2.4 KB
/
constants.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
const MOD = ['ctrl', 'alt', 'cmd'];
const MOD_S = [...MOD, 'shift'];
let VERBOSE = false;
const HALF_CORRECTION = 6; // Fix padding issues for half screen windows
var scr = Screen.main().flippedVisibleFrame();
// Padding Values
var paddingTop = 35;
var paddingLeft = 15;
var paddingRight = 30;
var paddingBottom = 25;
var paddingCenter = 10;
var paddingMiddle = 20;
// Computed sizes
var halfWidth = ((scr.width - paddingLeft) - paddingRight) / 2;
var halfHeight = (((scr.height - paddingTop) - paddingBottom) / 2) + HALF_CORRECTION;
var thirdWidth = ((scr.width - paddingLeft) - paddingRight) / 3;
var windowLocations = {
full: {
y: paddingTop,
x: paddingLeft,
width: scr.width - paddingRight,
height: scr.height - paddingBottom
},
left: {
y: paddingTop,
x: paddingLeft,
width: halfWidth - paddingCenter,
height: scr.height - paddingBottom
},
right: {
y: paddingTop,
x: (halfWidth + paddingLeft) + paddingCenter,
width: halfWidth,
height: scr.height - paddingBottom
},
//Corners
topRight: {
y: paddingTop,
x: (halfWidth + paddingLeft) + paddingCenter,
width: halfWidth,
height: halfHeight
},
bottomRight: {
y: (halfHeight + paddingTop) + paddingMiddle,
x: (halfWidth + paddingLeft) + paddingCenter,
width: halfWidth,
height: halfHeight
},
topLeft: {
y: paddingTop,
x: paddingLeft,
width: halfWidth - paddingCenter,
height: halfHeight
},
bottomLeft: {
y: (halfHeight + paddingTop) + paddingMiddle,
x: paddingLeft,
width: halfWidth - paddingCenter,
height: halfHeight
},
// Extra sizes
rightTwoThirds: {
y: paddingTop,
x: (thirdWidth + paddingLeft) + paddingCenter,
width: thirdWidth * 2,
height: scr.height - paddingBottom
},
leftTwoThirds: {
y: paddingTop,
x: paddingLeft,
width: (thirdWidth * 2) - paddingCenter,
height: scr.height - paddingBottom
},
leftThird: {
y: paddingTop,
x: paddingLeft,
width: thirdWidth - paddingCenter,
height: scr.height - paddingBottom
},
rightThird: {
y: paddingTop,
x: ((thirdWidth * 2) + paddingLeft) + paddingCenter,
width: thirdWidth,
height: scr.height - paddingBottom
}
}