1
0
mirror of https://github.com/kremalicious/blowfish.git synced 2024-12-26 22:57:51 +01:00

move to Electron 7.0.0 beta

* makes dark mode work on macOS Catalina
This commit is contained in:
Matthias Kretschmann 2019-10-08 00:15:15 +02:00
parent 6797dd37f0
commit e5306e7fba
Signed by: m
GPG Key ID: 606EEEF3C479A91F
3 changed files with 11 additions and 5 deletions

View File

@ -49,7 +49,7 @@
"copy-webpack-plugin": "^5.0.4",
"cross-env": "^6.0.3",
"css-loader": "^3.2.0",
"electron": "^6.0.11",
"electron": "beta",
"electron-builder": "^21.2.0",
"electron-devtools-installer": "^2.2.4",
"electron-store": "^5.0.0",

View File

@ -1,5 +1,11 @@
const path = require('path')
const { app, BrowserWindow, systemPreferences, ipcMain } = require('electron')
const {
app,
BrowserWindow,
systemPreferences,
nativeTheme,
ipcMain
} = require('electron')
const pkg = require('../../package.json')
const buildMenu = require('./menu')
const { buildTouchbar, updateTouchbar } = require('./touchbar')
@ -21,7 +27,7 @@ const width = 640
const height = 450
const createWindow = async () => {
const isDarkMode = systemPreferences.isDarkMode()
const isDarkMode = nativeTheme.shouldUseDarkColors
mainWindow = new BrowserWindow({
width,
@ -187,7 +193,7 @@ if (process.platform === 'windows') {
//
const switchTheme = () => {
if (process.platform === 'darwin') {
const isDarkMode = systemPreferences.isDarkMode()
const isDarkMode = nativeTheme.shouldUseDarkColors
isDarkMode
? mainWindow.webContents.executeJavaScript(

View File

@ -82,7 +82,7 @@ const buildMenu = mainWindow => {
if (process.platform === 'darwin') {
template.unshift({
label: app.getName(),
label: app.name,
submenu: [
{
role: 'about'