@@ -8,6 +8,7 @@ var _ = require('lodash');
8
8
var app = require ( 'app' ) ;
9
9
var attachMenu = require ( './menu' ) ;
10
10
var BrowserWindow = require ( 'browser-window' ) ;
11
+ var config = require ( './config' ) ;
11
12
var debug = require ( 'debug' ) ( 'scout-electron:window-manager' ) ;
12
13
13
14
/**
@@ -21,30 +22,6 @@ var RESOURCES = path.resolve(__dirname, '../../');
21
22
*/
22
23
var DEFAULT_URL = 'file://' + path . join ( RESOURCES , 'index.html#connect' ) ;
23
24
24
- /**
25
- * The outer dimensions to use for new windows.
26
- */
27
- var DEFAULT_WIDTH = 1024 ;
28
- var DEFAULT_HEIGHT = 700 ;
29
-
30
- /**
31
- * The outer window dimensions to use for new dialog
32
- * windows like the connection and setup dialogs.
33
- */
34
- var DEFAULT_WIDTH_DIALOG = 640 ;
35
- var DEFAULT_HEIGHT_DIALOG = 470 ;
36
- /**
37
- * Adjust the heights to account for platforms
38
- * that use a single menu bar at the top of the screen.
39
- */
40
- if ( process . platform === 'linux' ) {
41
- DEFAULT_HEIGHT_DIALOG -= 30 ;
42
- DEFAULT_HEIGHT -= 30 ;
43
- } else if ( process . platform === 'darwin' ) {
44
- DEFAULT_HEIGHT_DIALOG -= 60 ;
45
- DEFAULT_HEIGHT -= 60 ;
46
- }
47
-
48
25
/**
49
26
* We want want the Connect dialog window to be special
50
27
* and for there to ever only be one instance of it
@@ -71,8 +48,8 @@ var windowsOpenCount = 0;
71
48
*/
72
49
module . exports . create = function ( opts ) {
73
50
opts = _ . defaults ( opts || { } , {
74
- width : DEFAULT_WIDTH ,
75
- height : DEFAULT_HEIGHT ,
51
+ width : config . windows . DEFAULT_WIDTH ,
52
+ height : config . windows . DEFAULT_HEIGHT ,
76
53
url : DEFAULT_URL
77
54
} ) ;
78
55
@@ -135,8 +112,8 @@ app.on('show connect dialog', function(opts) {
135
112
136
113
opts = opts || { } ;
137
114
opts = _ . extend ( opts || { } , {
138
- height : DEFAULT_HEIGHT_DIALOG ,
139
- width : DEFAULT_WIDTH_DIALOG ,
115
+ width : config . windows . DEFAULT_WIDTH_DIALOG ,
116
+ height : config . windows . DEFAULT_HEIGHT_DIALOG ,
140
117
url : DEFAULT_URL
141
118
} ) ;
142
119
module . exports . create ( opts ) ;
0 commit comments