diff --git a/src/renderer/components/settings/Settings.tsx b/src/renderer/components/settings/Settings.tsx index c02019c..969ef41 100644 --- a/src/renderer/components/settings/Settings.tsx +++ b/src/renderer/components/settings/Settings.tsx @@ -14,7 +14,7 @@ import { isMac, isWindows } from "renderer/utils"; import { AutoStartToggle } from "./AutoStartToggle"; import { DiscordBranchPicker } from "./DiscordBranchPicker"; import { NotificationBadgeToggle } from "./NotificationBadgeToggle"; -import { TrayIconPicker } from "./TrayColorPicker"; +import { TrayIconPicker, TraySwitch } from "./TraySettings"; import { VencordLocationPicker } from "./VencordLocationPicker"; import { WindowsTransparencyControls } from "./WindowsTransparencyControls"; @@ -69,13 +69,7 @@ const SettingsOptions: Record> WindowsTransparencyControls ], Behaviour: [ - { - key: "tray", - title: "Tray Icon", - description: "Add a tray icon for Vesktop", - defaultValue: true, - invisible: () => isMac - }, + TraySwitch, TrayIconPicker, { key: "minimizeToTray", diff --git a/src/renderer/components/settings/TrayColorPicker.tsx b/src/renderer/components/settings/TraySettings.tsx similarity index 79% rename from src/renderer/components/settings/TrayColorPicker.tsx rename to src/renderer/components/settings/TraySettings.tsx index 8124c3c..9d67d47 100644 --- a/src/renderer/components/settings/TrayColorPicker.tsx +++ b/src/renderer/components/settings/TraySettings.tsx @@ -8,9 +8,9 @@ import "./traySetting.css"; import { Margins } from "@vencord/types/utils"; import { findByCodeLazy } from "@vencord/types/webpack"; -import { Forms } from "@vencord/types/webpack/common"; +import { Forms, Switch } from "@vencord/types/webpack/common"; import { isInCall, setCurrentState } from "renderer/patches/tray"; -import { isLinux } from "renderer/utils"; +import { isLinux, isMac } from "renderer/utils"; import { SettingsComponent } from "./Settings"; @@ -33,6 +33,22 @@ if (!isLinux) if (color) presets.unshift(color); }); +export const TraySwitch: SettingsComponent = ({ settings }) => { + if (isMac) return null; + return ( + { + settings.tray = t; + if (isInCall) setCurrentState(); + }} + note="Tray Icon" + > + Tray Icon + + ); +}; + export const TrayIconPicker: SettingsComponent = ({ settings }) => { if (!settings.tray) return null; return (