Merge remote-tracking branch 'origin/code-style/merge' into code-style/merge

This commit is contained in:
Borewit
2018-05-28 08:24:50 +02:00
3 changed files with 16 additions and 24 deletions

View File

@@ -32,7 +32,7 @@
"location-history": "^1.0.0",
"material-ui": "^0.17.0",
"mkdirp": "^0.5.1",
"music-metadata": "^1.0.0",
"music-metadata": "^1.1.0",
"network-address": "^1.1.0",
"parse-torrent": "^6.0.1",
"prettier-bytes": "^1.0.1",

View File

@@ -229,7 +229,7 @@ function uninstallWin32 () {
hive: Registry.HKCU,
key: `\\Software\\Classes\\${protocol}`
})
protocolKey.destroy(() => { })
protocolKey.destroy(() => {})
}
}
@@ -261,7 +261,7 @@ function uninstallWin32 () {
hive: Registry.HKCU, // HKEY_CURRENT_USER
key: `\\Software\\Classes\\${ext}`
})
extKey.destroy(() => { })
extKey.destroy(() => {})
}
}
}

View File

@@ -57,7 +57,7 @@ function init (state, options) {
win.setSheetOffset(config.UI_HEADER_HEIGHT)
}
win.webContents.on('dom-ready', function () {
win.webContents.on('dom-ready', () => {
menu.onToggleFullScreen(main.win.isFullScreen())
})
@@ -73,27 +73,27 @@ function init (state, options) {
win.on('hide', onWindowBlur)
win.on('show', onWindowFocus)
win.on('enter-full-screen', function () {
win.on('enter-full-screen', () => {
menu.onToggleFullScreen(true)
send('fullscreenChanged', true)
win.setMenuBarVisibility(false)
})
win.on('leave-full-screen', function () {
win.on('leave-full-screen', () => {
menu.onToggleFullScreen(false)
send('fullscreenChanged', false)
win.setMenuBarVisibility(true)
})
win.on('move', debounce(function (e) {
win.on('move', debounce(e => {
send('windowBoundsChanged', e.sender.getBounds())
}, 1000))
win.on('resize', debounce(function (e) {
win.on('resize', debounce(e => {
send('windowBoundsChanged', e.sender.getBounds())
}, 1000))
win.on('close', function (e) {
win.on('close', e => {
if (process.platform !== 'darwin') {
const tray = require('../tray')
if (!tray.hasTray()) {
@@ -143,23 +143,15 @@ function setBounds (bounds, maximize) {
}
// Maximize or minimize, if the second argument is present
let willBeMaximized
if (maximize === true) {
if (!main.win.isMaximized()) {
log('setBounds: maximizing')
main.win.maximize()
}
willBeMaximized = true
} else if (maximize === false) {
if (main.win.isMaximized()) {
log('setBounds: unmaximizing')
main.win.unmaximize()
}
willBeMaximized = false
} else {
willBeMaximized = main.win.isMaximized()
if (maximize === true && !main.win.isMaximized()) {
log('setBounds: maximizing')
main.win.maximize()
} else if (maximize === false && main.win.isMaximized()) {
log('setBounds: unmaximizing')
main.win.unmaximize()
}
const willBeMaximized = typeof maximize === 'boolean' ? maximize : main.win.isMaximized()
// Assuming we're not maximized or maximizing, set the window size
if (!willBeMaximized) {
log(`setBounds: setting bounds to ${JSON.stringify(bounds)}`)