Add spellcheck option

This commit is contained in:
smartfrigde 2023-05-13 23:48:11 +02:00
parent a90b348443
commit f4b394ecd4
5 changed files with 24 additions and 9 deletions

View file

@ -33,6 +33,8 @@
"settings-mobileMode-desc": "If you're on a device with touch-screen this feature is for you! It activates Discord's hidden mobile\n mode meant for phones and tablets. Only major feature missing is voice chat support. This is ideal for\n users on PinePhone and similar.", "settings-mobileMode-desc": "If you're on a device with touch-screen this feature is for you! It activates Discord's hidden mobile\n mode meant for phones and tablets. Only major feature missing is voice chat support. This is ideal for\n users on PinePhone and similar.",
"settings-dynamicIcon": "Dynamic icon", "settings-dynamicIcon": "Dynamic icon",
"settings-dynamicIcon-desc": "Following Discord's behaviour on Windows, this shows unread messages/pings count on ArmCord's icon instead of it's tray.", "settings-dynamicIcon-desc": "Following Discord's behaviour on Windows, this shows unread messages/pings count on ArmCord's icon instead of it's tray.",
"settings-spellcheck": "Spellcheck",
"settings-spellcheck-desc": "Helps you correct misspelled words by highlighting them.",
"settings-channel": "Discord channel", "settings-channel": "Discord channel",
"settings-channel-desc1": "You can use this setting to change current instance of Discord:", "settings-channel-desc1": "You can use this setting to change current instance of Discord:",
"settings-channel-desc2": "you're probably most familiar with this one. It's the one you see in default Discord\n client!", "settings-channel-desc2": "you're probably most familiar with this one. It's the one you see in default Discord\n client!",

View file

@ -126,9 +126,10 @@
dynamicIcon: false, dynamicIcon: false,
trayIcon: "default", trayIcon: "default",
startMinimized: false, startMinimized: false,
spellcheck: true,
performanceMode: "none" performanceMode: "none"
}); });
setTimeout(() => window.armcordinternal.restart(), 5000); setTimeout(() => window.armcordinternal.restart(), 500);
}); });
// Full // Full
@ -159,6 +160,7 @@
useLegacyCapturer: false, useLegacyCapturer: false,
alternativePaste: false, alternativePaste: false,
dynamicIcon: false, dynamicIcon: false,
spellcheck: true,
disableAutogain: false, disableAutogain: false,
startMinimized: false, startMinimized: false,
trayIcon: "default", trayIcon: "default",
@ -175,6 +177,7 @@
minimizeToTray: true, minimizeToTray: true,
automaticPatches: false, automaticPatches: false,
mobileMode: false, mobileMode: false,
spellcheck: true,
disableAutogain: false, disableAutogain: false,
mods: "none", mods: "none",
dynamicIcon: false, dynamicIcon: false,

View file

@ -112,6 +112,14 @@
</div> </div>
<br /> <br />
<div class="switch acSpellcheck">
<label class="header" data-string="settings-spellcheck"></label>
<input id="spellcheck" class="tgl tgl-light left" data-setting="spellcheck" type="checkbox" />
<label class="tgl-btn left" for="spellcheck"></label>
<p class="description" data-string="settings-spellcheck-desc"></p>
</div>
<br />
<div class="switch acChannel"> <div class="switch acChannel">
<select name="channel" data-setting="channel" class="left dropdown"> <select name="channel" data-setting="channel" class="left dropdown">
<option value="stable" selected>Stable</option> <option value="stable" selected>Stable</option>

View file

@ -46,6 +46,7 @@ export function setup(): void {
automaticPatches: false, automaticPatches: false,
alternativePaste: false, alternativePaste: false,
mods: "none", mods: "none",
spellcheck: true,
performanceMode: "none", performanceMode: "none",
skipSplash: false, skipSplash: false,
inviteWebsocket: true, inviteWebsocket: true,
@ -251,6 +252,7 @@ export interface Settings {
minimizeToTray: boolean; minimizeToTray: boolean;
automaticPatches: boolean; automaticPatches: boolean;
alternativePaste: boolean; alternativePaste: boolean;
spellcheck: boolean;
mods: string; mods: string;
dynamicIcon: boolean; dynamicIcon: boolean;
mobileMode: boolean; mobileMode: boolean;

View file

@ -286,7 +286,7 @@ async function doAfterDefiningTheWindow(): Promise<void> {
mainWindow.show(); mainWindow.show();
} }
} }
export function createCustomWindow(): void { export async function createCustomWindow(): Promise<void> {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 300, width: 300,
height: 350, height: 350,
@ -300,12 +300,12 @@ export function createCustomWindow(): void {
webPreferences: { webPreferences: {
sandbox: false, sandbox: false,
preload: path.join(__dirname, "preload/preload.js"), preload: path.join(__dirname, "preload/preload.js"),
spellcheck: true spellcheck: await getConfig("spellcheck")
} }
}); });
doAfterDefiningTheWindow(); doAfterDefiningTheWindow();
} }
export function createNativeWindow(): void { export async function createNativeWindow(): Promise<void> {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 300, width: 300,
height: 350, height: 350,
@ -319,12 +319,12 @@ export function createNativeWindow(): void {
webPreferences: { webPreferences: {
sandbox: false, sandbox: false,
preload: path.join(__dirname, "preload/preload.js"), preload: path.join(__dirname, "preload/preload.js"),
spellcheck: true spellcheck: await getConfig("spellcheck")
} }
}); });
doAfterDefiningTheWindow(); doAfterDefiningTheWindow();
} }
export function createTransparentWindow(): void { export async function createTransparentWindow(): Promise<void> {
mainWindow = new BrowserWindow({ mainWindow = new BrowserWindow({
width: 300, width: 300,
height: 350, height: 350,
@ -338,12 +338,12 @@ export function createTransparentWindow(): void {
webPreferences: { webPreferences: {
sandbox: false, sandbox: false,
preload: path.join(__dirname, "preload/preload.js"), preload: path.join(__dirname, "preload/preload.js"),
spellcheck: true spellcheck: await getConfig("spellcheck")
} }
}); });
doAfterDefiningTheWindow(); doAfterDefiningTheWindow();
} }
export function createInviteWindow(code: string): void { export async function createInviteWindow(code: string): Promise<void> {
inviteWindow = new BrowserWindow({ inviteWindow = new BrowserWindow({
width: 800, width: 800,
height: 600, height: 600,
@ -354,7 +354,7 @@ export function createInviteWindow(code: string): void {
autoHideMenuBar: true, autoHideMenuBar: true,
webPreferences: { webPreferences: {
sandbox: false, sandbox: false,
spellcheck: true spellcheck: await getConfig("spellcheck")
} }
}); });
let formInviteURL = `https://discord.com/invite/${code}`; let formInviteURL = `https://discord.com/invite/${code}`;