From 96b0652a0673ac781607d1944b62d29aceac42e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Vani=C5=A1?= Date: Fri, 24 Nov 2023 23:14:23 +0100 Subject: [PATCH] feat: Add option to disable smooth scrolling (#255) --- src/main/index.ts | 6 ++++++ src/renderer/components/Settings.tsx | 1 + src/shared/settings.d.ts | 1 + 3 files changed, 8 insertions(+) diff --git a/src/main/index.ts b/src/main/index.ts index c37d433..832afc8 100644 --- a/src/main/index.ts +++ b/src/main/index.ts @@ -24,6 +24,12 @@ if (IS_DEV) { process.env.VENCORD_USER_DATA_DIR = DATA_DIR; function init() { + const { disableSmoothScroll } = Settings.store; + + if (disableSmoothScroll) { + app.commandLine.appendSwitch("disable-smooth-scrolling"); + } + // work around chrome 66 disabling autoplay by default app.commandLine.appendSwitch("autoplay-policy", "no-user-gesture-required"); diff --git a/src/renderer/components/Settings.tsx b/src/renderer/components/Settings.tsx index e0dcd55..f818c3c 100644 --- a/src/renderer/components/Settings.tsx +++ b/src/renderer/components/Settings.tsx @@ -42,6 +42,7 @@ export default function SettingsUi() { ], ["staticTitle", "Static Title", 'Makes the window title "Vesktop" instead of changing to the current page'], ["enableMenu", "Enable Menu Bar", "Enables the application menu bar. Press ALT to toggle visibility."], + ["disableSmoothScroll", "Disable smooth scrolling", "Disables smooth scrolling in Vesktop", false], ["splashTheming", "Splash theming", "Adapt the splash window colors to your custom theme", false], [ "openLinksWithElectron", diff --git a/src/shared/settings.d.ts b/src/shared/settings.d.ts index 5b5fd4c..5cb6ca0 100644 --- a/src/shared/settings.d.ts +++ b/src/shared/settings.d.ts @@ -15,6 +15,7 @@ export interface Settings { openLinksWithElectron?: boolean; staticTitle?: boolean; enableMenu?: boolean; + disableSmoothScroll?: boolean; arRPC?: boolean; appBadge?: boolean; discordWindowsTitleBar?: boolean;