diff --git a/src/main/config/index.js b/src/main/config/index.js deleted file mode 100644 index 8aed97d121d..00000000000 --- a/src/main/config/index.js +++ /dev/null @@ -1,3 +0,0 @@ -module.exports = { - windows: require('./windows') -}; diff --git a/src/main/config/windows.js b/src/main/config/windows.js deleted file mode 100644 index 9c04726914d..00000000000 --- a/src/main/config/windows.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * Constants for window sizes on multiple platforms - */ - -/** -* The outer dimensions to use for new windows. -*/ -exports.DEFAULT_WIDTH = 1280; -exports.DEFAULT_HEIGHT = 800; - -exports.MIN_WIDTH = 1024; - -/** -* The outer window dimensions to use for new dialog -* windows like the connection and setup dialogs. -*/ -exports.DEFAULT_WIDTH_DIALOG = 900; -exports.DEFAULT_HEIGHT_DIALOG = 800; - -exports.MIN_WIDTH_DIALOG = 768; -/** -* Adjust the heights to account for platforms -* that use a single menu bar at the top of the screen. -*/ -if (process.platform === 'linux') { - exports.DEFAULT_HEIGHT_DIALOG -= 30; - exports.DEFAULT_HEIGHT -= 30; -} else if (process.platform === 'darwin') { - exports.DEFAULT_HEIGHT_DIALOG -= 60; - exports.DEFAULT_HEIGHT -= 60; -} - -module.exports = exports; diff --git a/src/main/window-manager.js b/src/main/window-manager.js index 1db2ee7d949..47ff203b88a 100644 --- a/src/main/window-manager.js +++ b/src/main/window-manager.js @@ -8,7 +8,7 @@ var BrowserWindow = electron.BrowserWindow; var _ = require('lodash'); var app = electron.app; -var config = require('./config'); + var migrate = require('./migrations'); var debug = require('debug')('mongodb-compass:electron:window-manager'); var dialog = electron.dialog; @@ -20,6 +20,38 @@ var ipc = require('hadron-ipc'); */ var RESOURCES = path.resolve(__dirname, '../app/'); +/** + * Constants for window sizes on multiple platforms + */ + +/** +* The outer dimensions to use for new windows. +*/ +let DEFAULT_WIDTH = 1280; +let DEFAULT_HEIGHT = 800; + +let MIN_WIDTH = 1024; + +/** +* The outer window dimensions to use for new dialog +* windows like the connection and setup dialogs. +*/ +let DEFAULT_WIDTH_DIALOG = 900; +let DEFAULT_HEIGHT_DIALOG = 800; + +let MIN_WIDTH_DIALOG = 768; +/** +* Adjust the heights to account for platforms +* that use a single menu bar at the top of the screen. +*/ +if (process.platform === 'linux') { + DEFAULT_HEIGHT_DIALOG -= 30; + DEFAULT_HEIGHT -= 30; +} else if (process.platform === 'darwin') { + DEFAULT_HEIGHT_DIALOG -= 60; + DEFAULT_HEIGHT -= 60; +} + /** * The app's HTML shell which is the output of `./src/index.html` * created by the `build:pages` gulp task. @@ -83,9 +115,9 @@ function isSingleInstance(_window) { */ module.exports.create = function(opts) { opts = _.defaults(opts || {}, { - width: config.windows.DEFAULT_WIDTH, - height: config.windows.DEFAULT_HEIGHT, - minwidth: config.windows.MIN_WIDTH, + width: DEFAULT_WIDTH, + height: DEFAULT_HEIGHT, + minwidth: MIN_WIDTH, url: DEFAULT_URL }); @@ -128,9 +160,9 @@ module.exports.create = function(opts) { function createWindow(opts, url) { opts = _.extend(opts, { - width: config.windows.DEFAULT_WIDTH, - height: config.windows.DEFAULT_HEIGHT, - minwidth: config.windows.MIN_WIDTH, + width: DEFAULT_WIDTH_DIALOG, + height: DEFAULT_HEIGHT_DIALOG, + minwidth: MIN_WIDTH_DIALOG, url: url }); return module.exports.create(opts);