mac: Hide tray related settings
This commit is contained in:
parent
c9f0920f71
commit
5fa9264bdb
2 changed files with 8 additions and 3 deletions
|
@ -10,6 +10,8 @@ import { Margins } from "@vencord/types/utils";
|
||||||
import { Button, Forms, Select, Switch, Text, useState } from "@vencord/types/webpack/common";
|
import { Button, Forms, Select, Switch, Text, useState } from "@vencord/types/webpack/common";
|
||||||
import { setBadge } from "renderer/appBadge";
|
import { setBadge } from "renderer/appBadge";
|
||||||
import { useSettings } from "renderer/settings";
|
import { useSettings } from "renderer/settings";
|
||||||
|
import { isMac } from "renderer/utils";
|
||||||
|
import { isTruthy } from "shared/utils/guards";
|
||||||
|
|
||||||
export default function SettingsUi() {
|
export default function SettingsUi() {
|
||||||
const Settings = useSettings();
|
const Settings = useSettings();
|
||||||
|
@ -18,9 +20,9 @@ export default function SettingsUi() {
|
||||||
const { autostart } = VesktopNative;
|
const { autostart } = VesktopNative;
|
||||||
const [autoStartEnabled, setAutoStartEnabled] = useState(autostart.isEnabled());
|
const [autoStartEnabled, setAutoStartEnabled] = useState(autostart.isEnabled());
|
||||||
|
|
||||||
const switches: [keyof typeof Settings, string, string, boolean?, (() => boolean)?][] = [
|
const allSwitches: Array<false | [keyof typeof Settings, string, string, boolean?, (() => boolean)?]> = [
|
||||||
["tray", "Tray Icon", "Add a tray icon for Vesktop", true],
|
!isMac && ["tray", "Tray Icon", "Add a tray icon for Vesktop", true],
|
||||||
[
|
!isMac && [
|
||||||
"minimizeToTray",
|
"minimizeToTray",
|
||||||
"Minimize to tray",
|
"Minimize to tray",
|
||||||
"Hitting X will make Vesktop minimize to the tray instead of closing",
|
"Hitting X will make Vesktop minimize to the tray instead of closing",
|
||||||
|
@ -41,6 +43,8 @@ export default function SettingsUi() {
|
||||||
["staticTitle", "Static Title", 'Makes the window title "Vencord" instead of changing to the current page']
|
["staticTitle", "Static Title", 'Makes the window title "Vencord" instead of changing to the current page']
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const switches = allSwitches.filter(isTruthy);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Forms.FormSection>
|
<Forms.FormSection>
|
||||||
<Text variant="heading-lg/semibold" style={{ color: "var(--header-primary)" }} tag="h2">
|
<Text variant="heading-lg/semibold" style={{ color: "var(--header-primary)" }} tag="h2">
|
||||||
|
|
|
@ -16,3 +16,4 @@ export const isFirstRun = (() => {
|
||||||
const { platform } = navigator;
|
const { platform } = navigator;
|
||||||
|
|
||||||
export const isWindows = platform.startsWith("Win");
|
export const isWindows = platform.startsWith("Win");
|
||||||
|
export const isMac = platform.startsWith("Mac");
|
||||||
|
|
Loading…
Reference in a new issue