From c29dd6d2d7ea9fb533a9414f3490c0378b84c8de Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 9 Apr 2023 05:57:45 +0200 Subject: [PATCH] Add option to not minimize to tray --- src/main/mainWindow.ts | 2 +- src/renderer/components/Settings.tsx | 1 + src/shared/settings.d.ts | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) 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; }