From 871054fd8e43b13a8f30d42c052605b42b669a6d Mon Sep 17 00:00:00 2001 From: MrGarlic1 Date: Wed, 19 Jun 2024 19:21:07 -0400 Subject: [PATCH] ux: condense customize tray settings --- src/renderer/components/settings/Settings.tsx | 10 ++---- .../components/settings/TraySettings.tsx | 34 +++++++++++++++++++ .../components/settings/traySetting.css | 10 +++--- 3 files changed, 40 insertions(+), 14 deletions(-) diff --git a/src/renderer/components/settings/Settings.tsx b/src/renderer/components/settings/Settings.tsx index e394dd5..2000991 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 { TrayFillColorSwitch, TrayIconPicker, TraySwitch } from "./TraySettings"; +import { TrayFillColorSwitch, TrayIconPicker, TraySwitch, CustomizeTraySwitch } from "./TraySettings"; import { VencordLocationPicker } from "./VencordLocationPicker"; import { WindowsTransparencyControls } from "./WindowsTransparencyControls"; @@ -70,13 +70,7 @@ const SettingsOptions: Record> ], Behaviour: [ TraySwitch, - { - key: "trayCustom", - title: "Use custom tray icons", - description: "Disable rewriting tray icons at config folder", - defaultValue: false, - invisible: () => Settings.store.tray === false - }, + CustomizeTraySwitch, TrayIconPicker, TrayFillColorSwitch, { diff --git a/src/renderer/components/settings/TraySettings.tsx b/src/renderer/components/settings/TraySettings.tsx index a0b5152..06f6b57 100644 --- a/src/renderer/components/settings/TraySettings.tsx +++ b/src/renderer/components/settings/TraySettings.tsx @@ -49,6 +49,40 @@ export const TraySwitch: SettingsComponent = ({ settings }) => { ); }; +export const CustomizeTraySwitch: SettingsComponent = ({ settings }) => { + if (!settings.tray) return null; + + return ( + <> +
+
+ (settings.trayCustom = v)} + note={"Use custom default and voice status tray icons."} + > + Use custom tray icons + +
+
+ + { + e.preventDefault(); + // Bring up modal here + }} + > + Configure + + +
+
+ + ); +}; + export const TrayIconPicker: SettingsComponent = ({ settings }) => { if (!settings.tray || settings.trayCustom) return null; return ( diff --git a/src/renderer/components/settings/traySetting.css b/src/renderer/components/settings/traySetting.css index c5b436e..7455f29 100644 --- a/src/renderer/components/settings/traySetting.css +++ b/src/renderer/components/settings/traySetting.css @@ -20,19 +20,17 @@ justify-content: space-between; align-items: center; flex-wrap: nowrap; - } .vcd-tray-setting-switch { flex-grow: 1; align-self: flex-start; - margin-right: 20rem; + margin-right: -3.6rem; } -.vcd-tray-setting-reset { +.vcd-tray-setting-customize { align-self: right; position: relative; - margin-left: auto; - margin-right: 1em; - bottom: 24px; + margin-right: 0em; + bottom: 4px; } .vcd-tray-icon-wrap {