Vanessa 2024-03-20 11:10:51 +08:00
parent 835a4eab3f
commit 97e3ff656d
3 changed files with 77 additions and 35 deletions

View file

@ -718,8 +718,40 @@ export const openMenu = (app: App, src: string, onlyMenu: boolean, showAccelerat
openAssetNewWindow(src.trim());
}
});
submenu.push({
icon: "iconFolder",
label: window.siyuan.languages.showInFolder,
accelerator: showAccelerator ? "⌘Click" : "",
click: () => {
openBy(src, "folder");
}
});
submenu.push({
label: window.siyuan.languages.useDefault,
accelerator: showAccelerator ? "⇧Click" : "",
click() {
openBy(src, "app");
}
});
/// #endif
} else {
/// #if !BROWSER
submenu.push({
label: window.siyuan.languages.useDefault,
accelerator: showAccelerator ? "Click" : "",
click() {
openBy(src, "app");
}
});
submenu.push({
icon: "iconFolder",
label: window.siyuan.languages.showInFolder,
accelerator: showAccelerator ? "⌘Click" : "",
click: () => {
openBy(src, "folder");
}
});
/// #else
submenu.push({
label: window.siyuan.languages.useBrowserView,
accelerator: showAccelerator ? "Click" : "",
@ -727,24 +759,8 @@ export const openMenu = (app: App, src: string, onlyMenu: boolean, showAccelerat
openByMobile(src);
}
});
/// #endif
}
/// #if !BROWSER
submenu.push({
icon: "iconFolder",
label: window.siyuan.languages.showInFolder,
accelerator: showAccelerator ? "⌘Click" : "",
click: () => {
openBy(src, "folder");
}
});
submenu.push({
label: window.siyuan.languages.useDefault,
accelerator: showAccelerator ? "⇧Click" : "",
click() {
openBy(src, "app");
}
});
/// #endif
} else if (src) {
if (0 > src.indexOf(":")) {
// 使用 : 判断,不使用 :// 判断 Open external application protocol invalid https://github.com/siyuan-note/siyuan/issues/10075