mod: optional use systemPreference.serUserDefault
This commit is contained in:
1 parent
9d1796212a
commit
9116b0b4d8
2 files changed
+8
-15
No files matched your search
+8
-2
@@ -1,7 +1,6 @@
|
|||||||
import { app, WebContents, RenderProcessGoneDetails } from 'electron'
|
import { app, WebContents, RenderProcessGoneDetails } from 'electron'
|
||||||
import Constants from './utils/Constants'
|
import Constants from './utils/Constants'
|
||||||
import { createErrorWindow, createMainWindow } from './MainRunner'
|
import { createErrorWindow, createMainWindow } from './MainRunner'
|
||||||
import { macOSDisableDefaultMenuItem } from './utils/Menus'
|
|
||||||
|
|
||||||
let mainWindow
|
let mainWindow
|
||||||
let errorWindow
|
let errorWindow
|
||||||
@@ -10,7 +9,14 @@ app.on('ready', async () => {
|
|||||||
if (Constants.IS_DEV_ENV) {
|
if (Constants.IS_DEV_ENV) {
|
||||||
import('./index.dev')
|
import('./index.dev')
|
||||||
}
|
}
|
||||||
macOSDisableDefaultMenuItem()
|
|
||||||
|
// Disable special menus on macOS by uncommenting the following, if necessary
|
||||||
|
/*
|
||||||
|
if (Constants.IS_MAC) {
|
||||||
|
systemPreferences.setUserDefault('NSDisabledDictationMenuItem', 'boolean', true)
|
||||||
|
systemPreferences.setUserDefault('NSDisabledCharacterPaletteMenuItem', 'boolean', true)
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
mainWindow = await createMainWindow(mainWindow)
|
mainWindow = await createMainWindow(mainWindow)
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,13 +0,0 @@
|
|||||||
import { systemPreferences } from 'electron'
|
|
||||||
import Constants from './Constants'
|
|
||||||
|
|
||||||
export default class Menus {
|
|
||||||
static macOSDisableDefaultMenuItem(): void {
|
|
||||||
if (Constants.IS_MAC) {
|
|
||||||
systemPreferences.setUserDefault('NSDisabledDictationMenuItem', 'boolean', true)
|
|
||||||
systemPreferences.setUserDefault('NSDisabledCharacterPaletteMenuItem', 'boolean', true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export const { macOSDisableDefaultMenuItem } = Menus
|
|
||||||
Reference in new issue
Block a user