From 0b6b729ab5c60b56ec7d7dc1c334114300371640 Mon Sep 17 00:00:00 2001 From: Vanessa Date: Sun, 8 Oct 2023 12:37:44 +0800 Subject: [PATCH] =?UTF-8?q?:art:=20=E6=96=B0=E7=89=88=20Electron=20?= =?UTF-8?q?=E6=94=AF=E6=8C=81=E5=8F=8C=E5=87=BB=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/boot/globalEvent/keydown.ts | 2 -- app/src/constants.ts | 1 + app/src/protyle/breadcrumb/index.ts | 16 +--------------- 3 files changed, 2 insertions(+), 17 deletions(-) diff --git a/app/src/boot/globalEvent/keydown.ts b/app/src/boot/globalEvent/keydown.ts index ffa5f5467..075e12d88 100644 --- a/app/src/boot/globalEvent/keydown.ts +++ b/app/src/boot/globalEvent/keydown.ts @@ -41,7 +41,6 @@ import {hintMoveBlock} from "../../protyle/hint/extend"; import {Backlink} from "../../layout/dock/Backlink"; /// #if !BROWSER import {setZoom} from "../../layout/topBar"; -import {getCurrentWindow} from "@electron/remote"; import {ipcRenderer} from "electron"; /// #endif import {openHistory} from "../../history/history"; @@ -1419,7 +1418,6 @@ export const sendGlobalShortcut = (app: App) => { }); ipcRenderer.send(Constants.SIYUAN_HOTKEY, { languages: window.siyuan.languages["_trayMenu"], - id: getCurrentWindow().id, hotkeys }); /// #endif diff --git a/app/src/constants.ts b/app/src/constants.ts index 6e3b675ca..75bef5730 100644 --- a/app/src/constants.ts +++ b/app/src/constants.ts @@ -26,6 +26,7 @@ export abstract class Constants { // 渲染进程调主进程 public static readonly SIYUAN_SHOW: string = "siyuan-show"; public static readonly SIYUAN_HIDE: string = "siyuan-hide"; + public static readonly SIYUAN_CONFIG_TRAY: string = "siyuan-config-tray"; public static readonly SIYUAN_QUIT: string = "siyuan-quit"; public static readonly SIYUAN_HOTKEY: string = "siyuan-hotkey"; diff --git a/app/src/protyle/breadcrumb/index.ts b/app/src/protyle/breadcrumb/index.ts index 64f1a4353..1fd9e91c5 100644 --- a/app/src/protyle/breadcrumb/index.ts +++ b/app/src/protyle/breadcrumb/index.ts @@ -18,7 +18,7 @@ import {openFileById} from "../../editor/util"; import {setPanelFocus} from "../../layout/util"; /// #endif /// #if !BROWSER -import {getCurrentWindow, systemPreferences} from "@electron/remote"; +import {systemPreferences} from "@electron/remote"; /// #endif import {onGet} from "../util/onGet"; import {hideElements} from "../ui/hideElements"; @@ -166,20 +166,6 @@ export class Breadcrumb { this.element.scrollLeft = this.element.scrollLeft + event.deltaY; }, {passive: true}); /// #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) {