/* * 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< false | [keyof typeof Settings, string, string, boolean?, (() => boolean)?, ((value: boolean) => void)?] > = [ isWindows && [ "discordWindowsTitleBar", "Discord Titlebar", "Use Discord's custom title bar instead of the Windows one. Requires a full restart." ], ["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."], ["disableSmoothScroll", "Disable smooth scrolling", "Disables smooth scrolling in Vesktop", false], ["splashTheming", "Splash theming", "Adapt the splash window colors to your custom theme", false], [ "openLinksWithElectron", "Open Links in app (experimental)", "Opens links in a new Vesktop window instead of your web browser" ], ["checkUpdates", "Check for updates", "Automatically check for Vesktop updates", true], ["startMinimized", "Start minimized", "Vesktop remains in minimized mode on start", false] ]; 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" )}
); }