Implement Add an option for disabling smooth scrolling #623 (#624)

This commit is contained in:
Aiden 2024-06-15 14:24:20 -04:00 committed by GitHub
parent 4d545ed684
commit 3ae9a77f25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 18 additions and 3 deletions

View file

@ -80,5 +80,7 @@
"settings-skipSplash-desc": "Skips ArmCord splash screen when you start up the app.", "settings-skipSplash-desc": "Skips ArmCord splash screen when you start up the app.",
"settings-copyDebugInfo": "Copy Debug Info", "settings-copyDebugInfo": "Copy Debug Info",
"settings-copyGPUInfo": "Copy GPU Info", "settings-copyGPUInfo": "Copy GPU Info",
"settings-forceNativeCrash": "Force native crash" "settings-forceNativeCrash": "Force native crash",
} "settings-smoothScroll": "Use smooth scrolling",
"settings-smoothScroll-desc": "Toggle smooth scrolling"
}

View file

@ -127,7 +127,8 @@ export function setup(): void {
trayIcon: "default", trayIcon: "default",
doneSetup: false, doneSetup: false,
clientName: "ArmCord", clientName: "ArmCord",
customIcon: path.join(import.meta.dirname, "../", "/assets/desktop.png") customIcon: path.join(import.meta.dirname, "../", "/assets/desktop.png"),
smoothScroll: true
}; };
setConfigBulk({ setConfigBulk({
...defaults ...defaults

View file

@ -107,6 +107,9 @@ if (!app.requestSingleInstanceLock()) {
checkIfConfigIsBroken(); checkIfConfigIsBroken();
injectElectronFlags(); injectElectronFlags();
console.log("[Config Manager] Current config: " + fs.readFileSync(getConfigLocation(), "utf-8")); console.log("[Config Manager] Current config: " + fs.readFileSync(getConfigLocation(), "utf-8"));
if (getConfig("smoothScroll") === false) {
app.commandLine.appendSwitch("disable-smooth-scrolling");
}
void app.whenReady().then(async () => { void app.whenReady().then(async () => {
// REVIEW - Awaiting the line above will cause a hang at startup // REVIEW - Awaiting the line above will cause a hang at startup
if (getConfig("customIcon") !== null) { if (getConfig("customIcon") !== null) {

View file

@ -100,6 +100,14 @@
</div> </div>
<br /> <br />
<div class="switch acSmoothScroll">
<label class="header" data-string="settings-smoothScroll"></label>
<input id="smoothScroll" class="tgl tgl-light left" data-setting="smoothScroll" type="checkbox" />
<label class="tgl-btn left" for="smoothScroll"></label>
<p class="description" data-string="settings-smoothScroll-desc"></p>
</div>
<br />
<div class="switch acAutogain"> <div class="switch acAutogain">
<label class="header" data-string="settings-disableAutogain"></label> <label class="header" data-string="settings-disableAutogain"></label>
<input id="disableAutogain" class="tgl tgl-light left" data-setting="disableAutogain" type="checkbox" /> <input id="disableAutogain" class="tgl tgl-light left" data-setting="disableAutogain" type="checkbox" />

View file

@ -28,4 +28,5 @@ export interface Settings {
trayIcon: string; trayIcon: string;
doneSetup: boolean; doneSetup: boolean;
clientName: string; clientName: string;
smoothScroll: boolean;
} }