diff --git a/app/src/config/editor.ts b/app/src/config/editor.ts index 5d8f8a0b5..b39426a6c 100644 --- a/app/src/config/editor.ts +++ b/app/src/config/editor.ts @@ -220,6 +220,14 @@ export const editor = { ${fontFamilyHTML} + + + ${window.siyuan.languages.fontSizeScrollZoom} + ${window.siyuan.languages.fontSizeScrollZoomTip.replace("Ctrl", updateHotkeyTip("⌘"))} + + + + ${window.siyuan.languages.fontSize} @@ -303,6 +311,7 @@ export const editor = { codeLigatures: (editor.element.querySelector("#codeLigatures") as HTMLInputElement).checked, codeTabSpaces: parseInt((editor.element.querySelector("#codeTabSpaces") as HTMLInputElement).value), fontSize: parseInt((editor.element.querySelector("#fontSize") as HTMLInputElement).value), + fontSizeScrollZoom: (editor.element.querySelector("#fontSizeScrollZoom") as HTMLInputElement).checked, generateHistoryInterval: parseInt((editor.element.querySelector("#generateHistoryInterval") as HTMLInputElement).value), historyRetentionDays: parseInt((editor.element.querySelector("#historyRetentionDays") as HTMLInputElement).value), fontFamily: fontFamilyElement.value, diff --git a/app/src/config/search.ts b/app/src/config/search.ts index 5864b666d..36dcc9071 100644 --- a/app/src/config/search.ts +++ b/app/src/config/search.ts @@ -20,7 +20,8 @@ export const initConfigSearch = (element: HTMLElement, app: App) => { "historyRetentionDays", "historyRetentionDaysTip", "clearHistory", "katexMacros", "katexMacrosTip", "editReadonly", "editReadonlyTip", "embedBlockBreadcrumb", "embedBlockBreadcrumbTip", "outlineOutdentTip", "outdent", "floatWindowMode", "floatWindowModeTip", "justify", "justifyTip", "rtl", "rtlTip", "spellcheck", - "spellcheckTip", "backlinkExpand", "backlinkExpandTip", "onlySearchForDocTip", "dynamicLoadBlocks", "dynamicLoadBlocksTip", + "spellcheckTip", "backlinkExpand", "backlinkExpandTip", "onlySearchForDocTip", "dynamicLoadBlocks", + "dynamicLoadBlocksTip", "fontSizeScrollZoom", "fontSizeScrollZoomTip" ]), // 文档树 diff --git a/app/src/protyle/ui/initUI.ts b/app/src/protyle/ui/initUI.ts index 0dacc8804..9264ab561 100644 --- a/app/src/protyle/ui/initUI.ts +++ b/app/src/protyle/ui/initUI.ts @@ -76,7 +76,7 @@ export const initUI = (protyle: IProtyle) => { let wheelTimeout: number; const isMacOS = isMac(); protyle.contentElement.addEventListener("mousewheel", (event: WheelEvent) => { - if ((isMacOS && !event.metaKey) || (!isMacOS && !event.ctrlKey) || event.deltaX !== 0) { + if (!window.siyuan.config.editor.fontSizeScrollZoom || (isMacOS && !event.metaKey) || (!isMacOS && !event.ctrlKey) || event.deltaX !== 0) { return; } event.preventDefault(); diff --git a/app/src/types/index.d.ts b/app/src/types/index.d.ts index 14a358394..51c34c2a7 100644 --- a/app/src/types/index.d.ts +++ b/app/src/types/index.d.ts @@ -380,6 +380,7 @@ declare interface IExport { declare interface IEditor { justify: boolean; + fontSizeScrollZoom: boolean; rtl: boolean; readOnly: boolean; listLogicalOutdent: boolean;