🎨 新版 Electron 支持双击缩放

This commit is contained in:
Vanessa 2023-10-08 12:37:44 +08:00
parent 3473011ca9
commit 0b6b729ab5
3 changed files with 2 additions and 17 deletions

View file

@ -41,7 +41,6 @@ import {hintMoveBlock} from "../../protyle/hint/extend";
import {Backlink} from "../../layout/dock/Backlink"; import {Backlink} from "../../layout/dock/Backlink";
/// #if !BROWSER /// #if !BROWSER
import {setZoom} from "../../layout/topBar"; import {setZoom} from "../../layout/topBar";
import {getCurrentWindow} from "@electron/remote";
import {ipcRenderer} from "electron"; import {ipcRenderer} from "electron";
/// #endif /// #endif
import {openHistory} from "../../history/history"; import {openHistory} from "../../history/history";
@ -1419,7 +1418,6 @@ export const sendGlobalShortcut = (app: App) => {
}); });
ipcRenderer.send(Constants.SIYUAN_HOTKEY, { ipcRenderer.send(Constants.SIYUAN_HOTKEY, {
languages: window.siyuan.languages["_trayMenu"], languages: window.siyuan.languages["_trayMenu"],
id: getCurrentWindow().id,
hotkeys hotkeys
}); });
/// #endif /// #endif

View file

@ -26,6 +26,7 @@ export abstract class Constants {
// 渲染进程调主进程 // 渲染进程调主进程
public static readonly SIYUAN_SHOW: string = "siyuan-show"; public static readonly SIYUAN_SHOW: string = "siyuan-show";
public static readonly SIYUAN_HIDE: string = "siyuan-hide"; public static readonly SIYUAN_HIDE: string = "siyuan-hide";
public static readonly SIYUAN_CONFIG_TRAY: string = "siyuan-config-tray"; public static readonly SIYUAN_CONFIG_TRAY: string = "siyuan-config-tray";
public static readonly SIYUAN_QUIT: string = "siyuan-quit"; public static readonly SIYUAN_QUIT: string = "siyuan-quit";
public static readonly SIYUAN_HOTKEY: string = "siyuan-hotkey"; public static readonly SIYUAN_HOTKEY: string = "siyuan-hotkey";

View file

@ -18,7 +18,7 @@ import {openFileById} from "../../editor/util";
import {setPanelFocus} from "../../layout/util"; import {setPanelFocus} from "../../layout/util";
/// #endif /// #endif
/// #if !BROWSER /// #if !BROWSER
import {getCurrentWindow, systemPreferences} from "@electron/remote"; import {systemPreferences} from "@electron/remote";
/// #endif /// #endif
import {onGet} from "../util/onGet"; import {onGet} from "../util/onGet";
import {hideElements} from "../ui/hideElements"; import {hideElements} from "../ui/hideElements";
@ -166,20 +166,6 @@ export class Breadcrumb {
this.element.scrollLeft = this.element.scrollLeft + event.deltaY; this.element.scrollLeft = this.element.scrollLeft + event.deltaY;
}, {passive: true}); }, {passive: true});
/// #endif /// #endif
/// #if !BROWSER
if ("windows" !== window.siyuan.config.system.os && "linux" !== window.siyuan.config.system.os) {
const currentWindow = getCurrentWindow();
element.querySelector(".protyle-breadcrumb__space").addEventListener("dblclick", (event) => {
if (hasClosestByClassName(event.target as HTMLElement, "fullscreen")) {
if (currentWindow.isMaximized()) {
currentWindow.unmaximize();
} else {
currentWindow.maximize();
}
}
});
}
/// #endif
} }
private startRecord(protyle: IProtyle) { private startRecord(protyle: IProtyle) {