Skip to content

Commit

Permalink
v1.6.2 - 修复在MacOS上无法使用快捷键复制粘贴文本的问题 - #5
Browse files Browse the repository at this point in the history
  • Loading branch information
Xmader committed Oct 30, 2018
1 parent 277aed0 commit 990828c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
20 changes: 17 additions & 3 deletions app/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@ const edit_conf = require('./edit_conf.js')

const { app, BrowserWindow, Menu, ipcMain } = electron

var mainWindow = null;
let mainWindow = null;

// console.dir(process.argv)
const isDev = process.argv.pop() == "dev";

// 增加右键菜单
Expand All @@ -43,6 +42,16 @@ if (isDev) {
}
const contextMenu = Menu.buildFromTemplate(contextMenuTemplate);

const appMenuTemplate = [
{
submenu: [{ label: "退出", role: "quit" }]
},
{
label: "编辑",
submenu: contextMenuTemplate
}
]


app.commandLine.appendSwitch('ignore-certificate-errors') // 忽略证书相关错误, 适用于使用自签名证书将Aria2的RPC配置成HTTPS协议的情况

Expand Down Expand Up @@ -80,7 +89,12 @@ app.on('ready', function () {
// 打开窗口的调试工具
//mainWindow.webContents.openDevTools();

mainWindow.setMenu(null);
if (platform == 'darwin') {
Menu.setApplicationMenu(Menu.buildFromTemplate(appMenuTemplate))
} else {
mainWindow.setMenu(null)
}

mainWindow.loadURL(`file://${__dirname}/pages/index.html`);

mainWindow.once('ready-to-show', function () {
Expand Down
2 changes: 1 addition & 1 deletion app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ariang-gui",
"version": "1.6.1",
"version": "1.6.2",
"private": true,
"description": "AriaNg GUI",
"main": "app.js",
Expand Down

0 comments on commit 990828c

Please sign in to comment.