This commit is contained in:
Vanessa 2023-05-27 22:59:01 +08:00
parent f25f06eb93
commit cae4ab17d2
4 changed files with 13 additions and 2 deletions

View file

@ -220,6 +220,14 @@ export const editor = {
<span class="fn__space"></span> <span class="fn__space"></span>
${fontFamilyHTML} ${fontFamilyHTML}
</label> </label>
<label class="fn__flex b3-label">
<div class="fn__flex-1">
${window.siyuan.languages.fontSizeScrollZoom}
<div class="b3-label__text">${window.siyuan.languages.fontSizeScrollZoomTip.replace("Ctrl", updateHotkeyTip("⌘"))}</div>
</div>
<span class="fn__space"></span>
<input class="b3-switch fn__flex-center" id="fontSizeScrollZoom" type="checkbox"${window.siyuan.config.editor.fontSizeScrollZoom ? " checked" : ""}/>
</label>
<label class="fn__flex b3-label config__item"> <label class="fn__flex b3-label config__item">
<div class="fn__flex-1"> <div class="fn__flex-1">
${window.siyuan.languages.fontSize} ${window.siyuan.languages.fontSize}
@ -303,6 +311,7 @@ export const editor = {
codeLigatures: (editor.element.querySelector("#codeLigatures") as HTMLInputElement).checked, codeLigatures: (editor.element.querySelector("#codeLigatures") as HTMLInputElement).checked,
codeTabSpaces: parseInt((editor.element.querySelector("#codeTabSpaces") as HTMLInputElement).value), codeTabSpaces: parseInt((editor.element.querySelector("#codeTabSpaces") as HTMLInputElement).value),
fontSize: parseInt((editor.element.querySelector("#fontSize") 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), generateHistoryInterval: parseInt((editor.element.querySelector("#generateHistoryInterval") as HTMLInputElement).value),
historyRetentionDays: parseInt((editor.element.querySelector("#historyRetentionDays") as HTMLInputElement).value), historyRetentionDays: parseInt((editor.element.querySelector("#historyRetentionDays") as HTMLInputElement).value),
fontFamily: fontFamilyElement.value, fontFamily: fontFamilyElement.value,

View file

@ -20,7 +20,8 @@ export const initConfigSearch = (element: HTMLElement, app: App) => {
"historyRetentionDays", "historyRetentionDaysTip", "clearHistory", "katexMacros", "katexMacrosTip", "historyRetentionDays", "historyRetentionDaysTip", "clearHistory", "katexMacros", "katexMacrosTip",
"editReadonly", "editReadonlyTip", "embedBlockBreadcrumb", "embedBlockBreadcrumbTip", "outlineOutdentTip", "editReadonly", "editReadonlyTip", "embedBlockBreadcrumb", "embedBlockBreadcrumbTip", "outlineOutdentTip",
"outdent", "floatWindowMode", "floatWindowModeTip", "justify", "justifyTip", "rtl", "rtlTip", "spellcheck", "outdent", "floatWindowMode", "floatWindowModeTip", "justify", "justifyTip", "rtl", "rtlTip", "spellcheck",
"spellcheckTip", "backlinkExpand", "backlinkExpandTip", "onlySearchForDocTip", "dynamicLoadBlocks", "dynamicLoadBlocksTip", "spellcheckTip", "backlinkExpand", "backlinkExpandTip", "onlySearchForDocTip", "dynamicLoadBlocks",
"dynamicLoadBlocksTip", "fontSizeScrollZoom", "fontSizeScrollZoomTip"
]), ]),
// 文档树 // 文档树

View file

@ -76,7 +76,7 @@ export const initUI = (protyle: IProtyle) => {
let wheelTimeout: number; let wheelTimeout: number;
const isMacOS = isMac(); const isMacOS = isMac();
protyle.contentElement.addEventListener("mousewheel", (event: WheelEvent) => { 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; return;
} }
event.preventDefault(); event.preventDefault();

View file

@ -380,6 +380,7 @@ declare interface IExport {
declare interface IEditor { declare interface IEditor {
justify: boolean; justify: boolean;
fontSizeScrollZoom: boolean;
rtl: boolean; rtl: boolean;
readOnly: boolean; readOnly: boolean;
listLogicalOutdent: boolean; listLogicalOutdent: boolean;