/* * SPDX-License-Identifier: GPL-3.0 * Vesktop, a desktop app aiming to give you a snappier Discord Experience * Copyright (c) 2023 Vendicated and Vencord contributors */ import "./settings.css"; import { Margins } from "@vencord/types/utils"; import { Button, Forms, Select, Switch, Text, Toasts, useState } from "@vencord/types/webpack/common"; import { setBadge } from "renderer/appBadge"; import { useSettings } from "renderer/settings"; import { isMac, isWindows } from "renderer/utils"; import { isTruthy } from "shared/utils/guards"; export default function SettingsUi() { const Settings = useSettings(); const supportsWindowsTransparency = VesktopNative.app.supportsWindowsTransparency(); const { autostart } = VesktopNative; const [autoStartEnabled, setAutoStartEnabled] = useState(autostart.isEnabled()); const allSwitches: Array boolean)?]> = [ isWindows && [ "discordWindowsTitleBar", "Discord Titlebar", "Use Discord's custom title bar instead of the Windows one. Requires a full restart." ], !isMac && ["tray", "Tray Icon", "Add a tray icon for Vesktop", true], !isMac && [ "minimizeToTray", "Minimize to tray", "Hitting X will make Vesktop minimize to the tray instead of closing", true, () => Settings.tray ?? true ], ["arRPC", "Rich Presence", "Enables Rich Presence via arRPC", false], [ "disableMinSize", "Disable minimum window size", "Allows you to make the window as small as your heart desires" ], ["staticTitle", "Static Title", 'Makes the window title "Vesktop" instead of changing to the current page'], ["enableMenu", "Enable Menu Bar", "Enables the application menu bar. Press ALT to toggle visibility."], [ "openLinksWithElectron", "Open Links in app (experimental)", "Opens links in a new Vesktop window instead of your web browser" ] ]; const switches = allSwitches.filter(isTruthy); return ( Vesktop Settings Discord Branch (Settings.transparencyOption = v)} isSelected={v => v === Settings.transparencyOption} serialize={s => s} /> )} Vencord Location Vencord files are loaded from{" "} {Settings.vencordDir ? ( { e.preventDefault(); VesktopNative.fileManager.showItemInFolder(Settings.vencordDir!); }} > {Settings.vencordDir} ) : ( "the default location" )}
); }