diff --git a/app/src/config/fileTree.ts b/app/src/config/fileTree.ts index 96f0c2678..80f561832 100644 --- a/app/src/config/fileTree.ts +++ b/app/src/config/fileTree.ts @@ -28,6 +28,14 @@ export const fileTree = { + + + ${window.siyuan.languages.noSplitScreenWhenOpenTab} + ${window.siyuan.languages.noSplitScreenWhenOpenTabTip} + + + + ${window.siyuan.languages.fileTree18} @@ -138,6 +146,7 @@ export const fileTree = { docCreateSaveBox: (fileTree.element.querySelector("#docCreateSaveBox") as HTMLInputElement).value, openFilesUseCurrentTab: (fileTree.element.querySelector("#openFilesUseCurrentTab") as HTMLInputElement).checked, closeTabsOnStart: (fileTree.element.querySelector("#closeTabsOnStart") as HTMLInputElement).checked, + noSplitScreenWhenOpenTab: (fileTree.element.querySelector("#noSplitScreenWhenOpenTab") as HTMLInputElement).checked, allowCreateDeeper: (fileTree.element.querySelector("#allowCreateDeeper") as HTMLInputElement).checked, removeDocWithoutConfirm: (fileTree.element.querySelector("#removeDocWithoutConfirm") as HTMLInputElement).checked, useSingleLineSave: (fileTree.element.querySelector("#useSingleLineSave") as HTMLInputElement).checked, diff --git a/app/src/config/search.ts b/app/src/config/search.ts index 94b0bb7ea..8d3d409f6 100644 --- a/app/src/config/search.ts +++ b/app/src/config/search.ts @@ -35,7 +35,8 @@ export const initConfigSearch = (element: HTMLElement, app: App) => { getLang(["selectOpen", "tabLimit", "fileTree", "fileTree2", "fileTree3", "fileTree4", "fileTree5", "fileTree6", "fileTree7", "fileTree8", "fileTree9", "fileTree10", "fileTree12", "fileTree13", "fileTree15", "fileTree16", "fileTree17", "fileTree18", "fileTree19", "fileTree20", "fileTree21", "fileTree22", "fileTree23", - "fileTree24", "fileTree25", "recentDocsMaxListCount", "recentDocsMaxListCountTip"]), + "fileTree24", "fileTree25", "recentDocsMaxListCount", "recentDocsMaxListCountTip", "noSplitScreenWhenOpenTab", + "noSplitScreenWhenOpenTabTip"]), // 闪卡 getLang(["riffCard", "flashcardNewCardLimit", "flashcardNewCardLimitTip", "flashcardReviewCardLimit", diff --git a/app/src/editor/openLink.ts b/app/src/editor/openLink.ts index 198d351cf..ecf0d033b 100644 --- a/app/src/editor/openLink.ts +++ b/app/src/editor/openLink.ts @@ -135,7 +135,7 @@ export const openLink = (protyle: IProtyle, aLink: string, event?: MouseEvent, c openByMobile(linkAddress); /// #endif } else { - openAsset(protyle.app, linkAddress, pdfParams, "right"); + openAsset(protyle.app, linkAddress, pdfParams, !window.siyuan.config.fileTree.noSplitScreenWhenOpenTab ? "right" : null); } } else { /// #if !BROWSER diff --git a/app/src/search/util.ts b/app/src/search/util.ts index 9ec132b24..f0449096a 100644 --- a/app/src/search/util.ts +++ b/app/src/search/util.ts @@ -76,7 +76,7 @@ export const openGlobalSearch = (app: App, text: string, replace: boolean, searc removed: localData.removed, page: 1 }, - position: (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024) ? "right" : undefined + position: (!window.siyuan.config.fileTree.noSplitScreenWhenOpenTab && (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024)) ? "right" : undefined }); }; @@ -593,7 +593,7 @@ export const genSearch = (app: App, config: Config.IUILayoutTabSearchConfig, ele openFile({ app, searchData: config, - position: (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024) ? "right" : undefined + position: (!window.siyuan.config.fileTree.noSplitScreenWhenOpenTab && (window.siyuan.layout.centerLayout.children.length > 1 || window.innerWidth > 1024)) ? "right" : undefined }); if (closeCB) { closeCB(); diff --git a/app/src/types/config.d.ts b/app/src/types/config.d.ts index cd90be0a1..0bdbff76c 100644 --- a/app/src/types/config.d.ts +++ b/app/src/types/config.d.ts @@ -629,6 +629,10 @@ declare namespace Config { * Whether to allow the creation of sub-documents deeper than 7 levels */ allowCreateDeeper: boolean; + /** + * Don't automatically split the screen when opening search, PDF and other tabs + */ + noSplitScreenWhenOpenTab: boolean; /** * Whether to automatically locate the currently open document in the document tree */