Final edits - Made submenu in Vesktop Settings
work
This commit is contained in:
parent
1c448b3f15
commit
2f40cfebbe
2 changed files with 56 additions and 2 deletions
53
src/renderer/components/settings/CustomSplashAnimation.tsx
Normal file
53
src/renderer/components/settings/CustomSplashAnimation.tsx
Normal 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>
|
||||||
|
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
|
@ -16,6 +16,7 @@ import { DiscordBranchPicker } from "./DiscordBranchPicker";
|
||||||
import { NotificationBadgeToggle } from "./NotificationBadgeToggle";
|
import { NotificationBadgeToggle } from "./NotificationBadgeToggle";
|
||||||
import { VencordLocationPicker } from "./VencordLocationPicker";
|
import { VencordLocationPicker } from "./VencordLocationPicker";
|
||||||
import { WindowsTransparencyControls } from "./WindowsTransparencyControls";
|
import { WindowsTransparencyControls } from "./WindowsTransparencyControls";
|
||||||
|
import { CustomSplashAnimation } from "./CustomSplashAnimation";
|
||||||
|
|
||||||
interface BooleanSetting {
|
interface BooleanSetting {
|
||||||
key: keyof typeof Settings.store;
|
key: keyof typeof Settings.store;
|
||||||
|
@ -126,8 +127,8 @@ const SettingsOptions: Record<string, Array<BooleanSetting | SettingsComponent>>
|
||||||
defaultValue: false
|
defaultValue: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"Vencord Location": [VencordLocationPicker],
|
"Custom Splash Animation":[CustomSplashAnimation],
|
||||||
"Custom Splash Animation":[]
|
"Vencord Location": [VencordLocationPicker]
|
||||||
};
|
};
|
||||||
|
|
||||||
function SettingsSections() {
|
function SettingsSections() {
|
||||||
|
|
Reference in a new issue