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-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-spellcheck": "Spellcheck",
"settings-spellcheck-desc": "Helps you correct misspelled words by highlighting them.",
"settings-channel": "Discord channel",
"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!",

View file

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

View file

@ -112,6 +112,14 @@
</div>
<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">
<select name="channel" data-setting="channel" class="left dropdown">
<option value="stable" selected>Stable</option>

View file

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

View file

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