Final edits - Made submenu in Vesktop Settings

work
This commit is contained in:
Sammie Zhang 2024-05-07 17:24:39 -07:00
parent 1c448b3f15
commit 2f40cfebbe
No known key found for this signature in database
GPG key ID: E8BCC9DD9CE177C6
2 changed files with 56 additions and 2 deletions

View file

@ -0,0 +1,53 @@
/*
* SPDX-License-Identifier: GPL-3.0
* Vesktop, a desktop app aiming to give you a snappier Discord Experience
* Copyright (c) 2024 Vendicated and Vencord contributors
*/
import { Button, Forms, Toasts } from "@vencord/types/webpack/common";
import { SettingsComponent } from "./Settings";
export const CustomSplashAnimation: SettingsComponent = ({ settings }) => {
return (
<>
<Forms.FormText>
The animation on the splash window is loaded from{" "}
{settings.splashAnimationPath ? (
<a
href="about:blank"
onClick={e => {
e.preventDefault();
VesktopNative.fileManager.showItemInFolder(settings.splashAnimationPath!);
}}
>
{settings.splashAnimationPath}
</a>
) : (
"the default location"
)}
</Forms.FormText>
<div className="vcd-location-btns" style={{marginBottom: 20}}>
<Button
size={Button.Sizes.SMALL}
onClick={async () => {
const choice = await VesktopNative.fileManager.selectImagePath();
if (choice === "cancelled") return;
settings.splashAnimationPath = choice;
}}
>
Change
</Button>
<Button
size={Button.Sizes.SMALL}
color={Button.Colors.RED}
onClick={() => (settings.splashAnimationPath = void 0)}
>
Reset
</Button>
</div>
</>
);
};

View file

@ -16,6 +16,7 @@ import { DiscordBranchPicker } from "./DiscordBranchPicker";
import { NotificationBadgeToggle } from "./NotificationBadgeToggle";
import { VencordLocationPicker } from "./VencordLocationPicker";
import { WindowsTransparencyControls } from "./WindowsTransparencyControls";
import { CustomSplashAnimation } from "./CustomSplashAnimation";
interface BooleanSetting {
key: keyof typeof Settings.store;
@ -126,8 +127,8 @@ const SettingsOptions: Record<string, Array<BooleanSetting | SettingsComponent>>
defaultValue: false
}
],
"Vencord Location": [VencordLocationPicker],
"Custom Splash Animation":[]
"Custom Splash Animation":[CustomSplashAnimation],
"Vencord Location": [VencordLocationPicker]
};
function SettingsSections() {