From c10c6f366186aa240dd3b53a6cc8a37ef72d65de Mon Sep 17 00:00:00 2001 From: zhandouxiaojiji Date: Fri, 9 Oct 2020 20:26:54 +0800 Subject: [PATCH] set dark theme --- main.tsx | 9 +++++---- src/components/Hello.tsx | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/main.tsx b/main.tsx index 6073477..7b3f6f6 100644 --- a/main.tsx +++ b/main.tsx @@ -1,6 +1,7 @@ -import { app, BrowserWindow, Menu, MenuItem, dialog } from 'electron'; +import { app, BrowserWindow, Menu, MenuItem, dialog, nativeTheme } from 'electron'; let mainWindow: BrowserWindow = null; +nativeTheme.themeSource = 'dark'; let createWindow = function () { mainWindow = new BrowserWindow({ width: 800, @@ -10,9 +11,9 @@ let createWindow = function () { } // fullscreenable:false, // maximizable:false - }) - mainWindow.webContents.openDevTools() - mainWindow.loadFile('index.html') + }); + mainWindow.webContents.openDevTools(); + mainWindow.loadFile('index.html'); mainWindow.on('closed', function () { mainWindow = null }) diff --git a/src/components/Hello.tsx b/src/components/Hello.tsx index 9ff5bd5..b5fad01 100644 --- a/src/components/Hello.tsx +++ b/src/components/Hello.tsx @@ -23,7 +23,7 @@ const data: MindData = { export default class Hello extends React.Component { render() { return ( - +