From d76081458beb9ec16adf3636900079920a16e5b4 Mon Sep 17 00:00:00 2001 From: Nullmatic Date: Thu, 16 Nov 2023 00:16:41 -0600 Subject: [PATCH] feat: Implement MiddleClickAutoScroll setting (#171) --- src/main/mainWindow.ts | 5 ++++- src/renderer/components/Settings.tsx | 1 + src/shared/settings.d.ts | 1 + 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/mainWindow.ts b/src/main/mainWindow.ts index 8fdb6ee..983d8ea 100644 --- a/src/main/mainWindow.ts +++ b/src/main/mainWindow.ts @@ -389,7 +389,8 @@ function createMainWindow() { contextIsolation: true, devTools: true, preload: join(__dirname, "preload.js"), - spellcheck: true + spellcheck: true, + ...(Settings.store.middleClickScroll && {enableBlinkFeatures: 'MiddleClickAutoscroll'}) }, icon: ICON_PATH, frame: !noFrame, @@ -406,6 +407,8 @@ function createMainWindow() { })); win.setMenuBarVisibility(false); + if(Settings.store.middleClickScroll) + win.on("close", e => { const useTray = !isDeckGameMode && Settings.store.minimizeToTray !== false && Settings.store.tray !== false; if (isQuitting || (process.platform !== "darwin" && !useTray)) return; diff --git a/src/renderer/components/Settings.tsx b/src/renderer/components/Settings.tsx index e0dcd55..19e5169 100644 --- a/src/renderer/components/Settings.tsx +++ b/src/renderer/components/Settings.tsx @@ -34,6 +34,7 @@ export default function SettingsUi() { true, () => Settings.tray ?? true ], + !isMac && ["middleClickScroll", "Middle Click Scroll", "Middle clicking scrolls instead of pastes", false], ["arRPC", "Rich Presence", "Enables Rich Presence via arRPC", false], [ "disableMinSize", diff --git a/src/shared/settings.d.ts b/src/shared/settings.d.ts index 5b5fd4c..5085135 100644 --- a/src/shared/settings.d.ts +++ b/src/shared/settings.d.ts @@ -12,6 +12,7 @@ export interface Settings { transparencyOption?: "none" | "mica" | "tabbed" | "acrylic"; tray?: boolean; minimizeToTray?: boolean; + middleClickScroll?: boolean; openLinksWithElectron?: boolean; staticTitle?: boolean; enableMenu?: boolean;