Move isAeroGlassEnabled and isDarkMode to systemPreferences
This commit is contained in:
parent
d72a0e452f
commit
ddd8eae661
8 changed files with 46 additions and 35 deletions
|
@ -1,8 +1,7 @@
|
|||
'use strict'
|
||||
|
||||
const deprecate = require('electron').deprecate
|
||||
const session = require('electron').session
|
||||
const Menu = require('electron').Menu
|
||||
const electron = require('electron')
|
||||
const {deprecate, session, Menu} = electron
|
||||
const EventEmitter = require('events').EventEmitter
|
||||
|
||||
const bindings = process.atomBinding('app')
|
||||
|
@ -65,39 +64,40 @@ for (i = 0, len = ref1.length; i < len; i++) {
|
|||
}
|
||||
|
||||
// Deprecated.
|
||||
|
||||
app.getHomeDir = deprecate('app.getHomeDir', 'app.getPath', function () {
|
||||
return this.getPath('home')
|
||||
})
|
||||
|
||||
app.getDataPath = deprecate('app.getDataPath', 'app.getPath', function () {
|
||||
return this.getPath('userData')
|
||||
})
|
||||
|
||||
app.setDataPath = deprecate('app.setDataPath', 'app.setPath', function (path) {
|
||||
return this.setPath('userData', path)
|
||||
})
|
||||
|
||||
app.resolveProxy = deprecate('app.resolveProxy', 'session.defaultSession.resolveProxy', function (url, callback) {
|
||||
return session.defaultSession.resolveProxy(url, callback)
|
||||
})
|
||||
|
||||
deprecate.rename(app, 'terminate', 'quit')
|
||||
|
||||
deprecate.event(app, 'finish-launching', 'ready', function () {
|
||||
// give default app a chance to setup default menu.
|
||||
setImmediate(() => {
|
||||
this.emit('finish-launching')
|
||||
})
|
||||
})
|
||||
|
||||
deprecate.event(app, 'activate-with-no-open-windows', 'activate', function (event, hasVisibleWindows) {
|
||||
if (!hasVisibleWindows) {
|
||||
return this.emit('activate-with-no-open-windows', event)
|
||||
}
|
||||
})
|
||||
|
||||
deprecate.event(app, 'select-certificate', 'select-client-certificate')
|
||||
if (process.platform === 'win32') {
|
||||
app.isAeroGlassEnabled = deprecate('app.isAeroGlassEnabled', 'systemPreferences.isAeroGlassEnabled', function () {
|
||||
return electron.systemPreferences.isAeroGlassEnabled();
|
||||
})
|
||||
} else if (process.platform === 'darwin') {
|
||||
app.isDarkMode = deprecate('app.isDarkMode', 'systemPreferences.isDarkMode', function () {
|
||||
return electron.systemPreferences.isDarkMode();
|
||||
})
|
||||
}
|
||||
|
||||
// Wrappers for native classes.
|
||||
var wrapDownloadItem = function (downloadItem) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue