chore: API改为类,成员函数变量增加static关键字 & yarn lint

This commit is contained in:
noe
2022-09-24 11:44:04 +08:00
parent 17436b0e9a
commit cfc10a6aee
25 changed files with 727 additions and 681 deletions

View File

@@ -22,56 +22,57 @@ function createTray(window: BrowserWindow): Promise<Tray> {
const getShowAndHiddenHotKey = (): string => {
const config = global.OP_CONFIG.get();
return config.perf.shortCut.showAndHidden;
}
};
const createContextMenu = () => Menu.buildFromTemplate([
{
label: "帮助文档",
click: () => {
process.nextTick(() => {
shell.openExternal("https://github.com/clouDr-f2e/rubick");
});
const createContextMenu = () =>
Menu.buildFromTemplate([
{
label: "帮助文档",
click: () => {
process.nextTick(() => {
shell.openExternal("https://github.com/clouDr-f2e/rubick");
});
},
},
},
{
label: "意见反馈",
click: () => {
process.nextTick(() => {
shell.openExternal("https://github.com/clouDr-f2e/rubick/issues");
});
{
label: "意见反馈",
click: () => {
process.nextTick(() => {
shell.openExternal("https://github.com/clouDr-f2e/rubick/issues");
});
},
},
},
{ type: "separator" },
{
label: "显示窗口",
accelerator: getShowAndHiddenHotKey(),
click() {
window.show();
{ type: "separator" },
{
label: "显示窗口",
accelerator: getShowAndHiddenHotKey(),
click() {
window.show();
},
},
},
{
role: "quit",
label: "退出",
},
{
label: "重启",
click() {
app.relaunch();
app.quit();
{
role: "quit",
label: "退出",
},
},
{ type: "separator" },
{
label: "关于",
click() {
dialog.showMessageBox({
title: "拉比克",
message: "极简、插件化的现代桌面软件",
detail: `Version: ${pkg.version}\nAuthor: muwoo`,
});
{
label: "重启",
click() {
app.relaunch();
app.quit();
},
},
},
]);
{ type: "separator" },
{
label: "关于",
click() {
dialog.showMessageBox({
title: "拉比克",
message: "极简、插件化的现代桌面软件",
detail: `Version: ${pkg.version}\nAuthor: muwoo`,
});
},
},
]);
appIcon.on("click", () => {
appIcon.setContextMenu(createContextMenu());
appIcon.popUpContextMenu();