mirror of
https://github.com/Vencord/Vesktop.git
synced 2025-02-23 21:55:09 +00:00
fix: show proper icon after toggle setting in VC
This commit is contained in:
parent
c931d7d5e2
commit
d44df8abaa
2 changed files with 20 additions and 10 deletions
|
@ -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<string, Array<BooleanSetting | SettingsComponent>>
|
|||
WindowsTransparencyControls
|
||||
],
|
||||
Behaviour: [
|
||||
{
|
||||
key: "tray",
|
||||
title: "Tray Icon",
|
||||
description: "Add a tray icon for Vesktop",
|
||||
defaultValue: true,
|
||||
invisible: () => isMac
|
||||
},
|
||||
TraySwitch,
|
||||
TrayIconPicker,
|
||||
{
|
||||
key: "minimizeToTray",
|
||||
|
|
|
@ -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 (
|
||||
<Switch
|
||||
value={settings.tray ?? true}
|
||||
onChange={async t => {
|
||||
settings.tray = t;
|
||||
if (isInCall) setCurrentState();
|
||||
}}
|
||||
note="Tray Icon"
|
||||
>
|
||||
Tray Icon
|
||||
</Switch>
|
||||
);
|
||||
};
|
||||
|
||||
export const TrayIconPicker: SettingsComponent = ({ settings }) => {
|
||||
if (!settings.tray) return null;
|
||||
return (
|
Loading…
Add table
Reference in a new issue