mirror of
https://github.com/Vendicated/Vencord.git
synced 2024-09-19 22:20:34 +00:00
rename and add setting
This commit is contained in:
parent
073b561db1
commit
7eeeceea1c
4 changed files with 13 additions and 10 deletions
|
@ -7,9 +7,8 @@
|
|||
import { closeModal, ModalContent, ModalHeader, ModalRoot, openModalLazy } from "@utils/modal";
|
||||
import { Button, Menu, Slider, TextInput, useState } from "@webpack/common";
|
||||
|
||||
import { folderProp } from ".";
|
||||
import settings, { folderIconsData } from "./settings";
|
||||
import { int2rgba, setFolderData } from "./util";
|
||||
import { folderProp, int2rgba, setFolderData } from "./util";
|
||||
|
||||
export function ImageModal(folderProps: folderProp) {
|
||||
const [data, setData] = useState(((settings.store.folderIcons ?? {}) as folderIconsData)[folderProps.folderId]?.url ?? "");
|
||||
|
|
|
@ -9,11 +9,8 @@ import definePlugin from "@utils/types";
|
|||
|
||||
import { makeContextItem } from "./components";
|
||||
import settings, { folderIconsData } from "./settings";
|
||||
import { int2rgba } from "./util";
|
||||
export interface folderProp {
|
||||
folderId: string;
|
||||
folderColor: number;
|
||||
}
|
||||
import { folderProp, int2rgba } from "./util";
|
||||
|
||||
export default definePlugin({
|
||||
settings,
|
||||
name: "CustomFolderIcons",
|
||||
|
@ -46,7 +43,7 @@ export default definePlugin({
|
|||
return (
|
||||
<div
|
||||
style={{
|
||||
backgroundColor: int2rgba(props.folderNode.color, .4),
|
||||
backgroundColor: int2rgba(props.folderNode.color, +settings.store.solidIcon || .4),
|
||||
display: "flex",
|
||||
justifyContent: "center",
|
||||
alignItems: "center",
|
||||
|
|
|
@ -14,6 +14,11 @@ export interface folderIcon{
|
|||
export type folderIconsData = Record<string, folderIcon | null>;
|
||||
|
||||
const settings = definePluginSettings({
|
||||
solidIcon: {
|
||||
type: OptionType.BOOLEAN,
|
||||
default: false,
|
||||
description: "Use a solid background on the background of the image"
|
||||
},
|
||||
folderIcons: {
|
||||
type: OptionType.COMPONENT,
|
||||
hidden: true,
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*/
|
||||
|
||||
import { folderProp } from ".";
|
||||
import settings, { folderIcon, folderIconsData } from "./settings";
|
||||
|
||||
export async function setFolderData(props: folderProp, newData: folderIcon) {
|
||||
|
@ -14,7 +13,10 @@ export async function setFolderData(props: folderProp, newData: folderIcon) {
|
|||
const folderSettings = (settings.store.folderIcons as folderIconsData);
|
||||
folderSettings[props.folderId] = newData;
|
||||
}
|
||||
|
||||
export interface folderProp {
|
||||
folderId: string;
|
||||
folderColor: number;
|
||||
}
|
||||
/**
|
||||
* @param rgbVal RGB value
|
||||
* @param alpha alpha bewteen zero and 1
|
||||
|
|
Loading…
Reference in a new issue