diff --git a/src/main/mainWindow.ts b/src/main/mainWindow.ts index c2678a9..e1d3e2a 100644 --- a/src/main/mainWindow.ts +++ b/src/main/mainWindow.ts @@ -222,7 +222,7 @@ export function createMainWindow() { }); win.on("close", e => { - if (isQuitting) return; + if (isQuitting || Settings.minimizeToTray === false) return; e.preventDefault(); win.hide(); diff --git a/src/renderer/components/Settings.tsx b/src/renderer/components/Settings.tsx index 7ee2848..522527b 100644 --- a/src/renderer/components/Settings.tsx +++ b/src/renderer/components/Settings.tsx @@ -10,6 +10,7 @@ export default function SettingsUi() { const { Forms: { FormSection, FormText, FormDivider, FormSwitch, FormTitle }, Text, Select, Button } = Common; const switches: [keyof typeof Settings, string, string, boolean?][] = [ + ["minimizeToTray", "Minimize to tray", "Hitting X will make Discord minimize to the tray instead of closing", true], ["openLinksWithElectron", "Open Links in app", "Opens links in a new window instead of your WebBrowser"], ["disableMinSize", "Disable minimum window size", "Allows you to resize the window smaller than the default size"], ]; diff --git a/src/shared/settings.d.ts b/src/shared/settings.d.ts index 6b2671b..f48b874 100644 --- a/src/shared/settings.d.ts +++ b/src/shared/settings.d.ts @@ -8,4 +8,5 @@ export interface Settings { openLinksWithElectron?: boolean; vencordDir?: string; disableMinSize?: boolean; + minimizeToTray?: boolean; }