Skip to content

Commit

Permalink
feat: Implement MiddleClickAutoScroll setting (Vencord#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nullmatic committed Nov 16, 2023
1 parent 94819e6 commit d760814
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/main/mainWindow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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;
Expand Down
1 change: 1 addition & 0 deletions src/renderer/components/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions src/shared/settings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface Settings {
transparencyOption?: "none" | "mica" | "tabbed" | "acrylic";
tray?: boolean;
minimizeToTray?: boolean;
middleClickScroll?: boolean;
openLinksWithElectron?: boolean;
staticTitle?: boolean;
enableMenu?: boolean;
Expand Down

0 comments on commit d760814

Please sign in to comment.