@@ -8,6 +8,7 @@ var _ = require('lodash');
88var app = require ( 'app' ) ;
99var attachMenu = require ( './menu' ) ;
1010var BrowserWindow = require ( 'browser-window' ) ;
11+ var config = require ( './config' ) ;
1112var debug = require ( 'debug' ) ( 'scout-electron:window-manager' ) ;
1213
1314/**
@@ -21,30 +22,6 @@ var RESOURCES = path.resolve(__dirname, '../../');
2122 */
2223var DEFAULT_URL = 'file://' + path . join ( RESOURCES , 'index.html#connect' ) ;
2324
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-
4825/**
4926 * We want want the Connect dialog window to be special
5027 * and for there to ever only be one instance of it
@@ -71,8 +48,8 @@ var windowsOpenCount = 0;
7148 */
7249module . exports . create = function ( opts ) {
7350 opts = _ . defaults ( opts || { } , {
74- width : DEFAULT_WIDTH ,
75- height : DEFAULT_HEIGHT ,
51+ width : config . windows . DEFAULT_WIDTH ,
52+ height : config . windows . DEFAULT_HEIGHT ,
7653 url : DEFAULT_URL
7754 } ) ;
7855
@@ -135,8 +112,8 @@ app.on('show connect dialog', function(opts) {
135112
136113 opts = opts || { } ;
137114 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 ,
140117 url : DEFAULT_URL
141118 } ) ;
142119 module . exports . create ( opts ) ;
0 commit comments