Merge branch 'dev_v3' into test_v3

This commit is contained in:
gaoshuaixing
2024-03-07 15:05:26 +08:00
4 changed files with 31 additions and 4 deletions

View File

@@ -62,8 +62,8 @@ class TrayAddon {
this.tray.setToolTip(cfg.title);
const contextMenu = Menu.buildFromTemplate(trayMenuTemplate);
this.tray.setContextMenu(contextMenu);
// 左键击的时候能够显示主窗口
this.tray.on('double-click', () => {
// 左键击的时候能够显示主窗口
this.tray.on('click', () => {
mainWindow.show()
})
}

View File

@@ -52,8 +52,8 @@ module.exports = {
},
python_w: {
directory: './python',
cmd: 'pyinstaller',
args: ['-n=pyapp', '-F', './main.py'],
cmd: 'python',
args: ['./setup.py', 'build'],
},
python_m: {
directory: './python',

View File

@@ -1,4 +1,5 @@
const { Application } = require('ee-core');
const { app: electronApp } = require("electron");
class Index extends Application {
@@ -12,6 +13,8 @@ class Index extends Application {
*/
async ready () {
// do some things
electronApp.commandLine.appendSwitch('enable-webgl');
electronApp.commandLine.appendSwitch("disable-web-security");
}
/**

24
python/setup.py Normal file
View File

@@ -0,0 +1,24 @@
from cx_Freeze import setup, Executable
# 创建可执行文件的配置
executableApp = Executable(
script="main.py",
target_name="pyapp",
)
# 打包的参数配置
options = {
"build_exe": {
"build_exe":"./dist/",
"excludes": ["*.txt"],
"optimize": 2,
}
}
setup(
name="pyapp",
version="1.0",
description="python app",
options=options,
executables=[executableApp]
)