Ai
2 Star 9 Fork 0

itpika/knight-redis

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
startup.js 1.64 KB
一键复制 编辑 原始数据 按行查看 历史
dalgurak 提交于 2021-02-24 17:00 +08:00 . mitc
const { app, BrowserWindow, globalShortcut } = require('electron')
require('./lib/channel/event.js')
require('./lib/channel/disk.js')
function createWindow () {
const win = require('./lib/windows/index.js')
win.removeMenu()
// 加载index.html文件
win.loadFile('dist/index.html')
//当所有窗口都被关闭后退出
app.on('window-all-closed', () => {
// 在 macOS 上,除非用户用 Cmd + Q 确定地退出,
// 否则绝大部分应用及其菜单栏会保持激活。
if (process.platform !== 'darwin') {
app.quit()
}
})
// shell.openPath('/var/code')
// win.webContents.openDevTools()
}
app.on('activate', () => {
// 在macOS上,当单击dock图标并且没有其他窗口打开时,
// 通常在应用程序中重新创建一个窗口。
if (BrowserWindow.getAllWindows().length === 0) {
createWindow()
}
})
app.whenReady().then(() => {
globalShortcut.register('Command+Q', () => {
if (process.platform === 'darwin') { // 手动处理mac的退出程序
app.quit()
}
});
require('./lib/windows/index.js').setTouchBar(require('./lib/windows/touchbar.js'));
// 手动处理macOS复制粘贴无效
// if (process.platform === 'darwin') {
// const win = require('./lib/windows/index.js');
// globalShortcut.register('Command+C', () => {
// if (win.isFocused()) win.webContents.copy();
// });
// globalShortcut.register('Command+V', () => {
// if (win.isFocused()) win.webContents.paste();
// });
// globalShortcut.register('Command+A', () => {
// if (win.isFocused()) win.webContents.selectAll();
// });
// }
}).then(createWindow)
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
JavaScript
1
https://gitee.com/dalgurkak/knight-redis.git
git@gitee.com:dalgurkak/knight-redis.git
dalgurkak
knight-redis
knight-redis
master

搜索帮助