This commit is contained in:
Mirco Wittrien 2024-04-02 19:14:42 +02:00
parent 3235508792
commit fec881d4a5
3 changed files with 308 additions and 297 deletions

View File

@ -979,6 +979,11 @@ input[REPLACE_CLASS_input][REPLACE_CLASS_inputerror] {
left: 0;
}
[REPLACE_CLASS_guildswrapper] [style*="--folder-color"] [REPLACE_CLASS_guildfolderexpandedbackground] {
background: var(--folder-color) !important;
opacity: 0.2 !important;
}
[REPLACE_CLASS_svgiconwrapper] {
display: flex;
justify-content: center;

View File

@ -261,7 +261,7 @@ module.exports = (_ => {
}
processFolderItemWrapper (e) {
if (!e.instance.props.folderNode) return;
if (!e.instance.props.folderNode && e.returnvalue.props.style["--folder-color"]) return;
let folderColor = this.settings.general.addFolderColor && BDFDB.LibraryStores.ExpandedGuildFolderStore.isFolderExpanded(e.instance.props.folderNode.id) && (BDFDB.ColorUtils.convert(e.instance.props.folderNode.color, "HEX") || BDFDB.ColorUtils.convert(BDFDB.DiscordConstants.Colors.BRAND, "RGB"));
if (folderColor) e.returnvalue = BDFDB.ReactUtils.createElement("div", {
style: {"--folder-color": folderColor},
@ -536,10 +536,6 @@ module.exports = (_ => {
width: auto;
border-radius: 4px;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCN.guildswrapper} [style*="--folder-color"] ${BDFDB.dotCN.guildfolderexpandedbackground} {
background: var(--folder-color) !important;
opacity: 0.2 !important;
}
${BDFDB.dotCNS._displayserversaschannelsstyled + BDFDB.dotCNS.guildswrapper + BDFDB.dotCN.guildfolderwrapper} [role="group"] {
height: auto !important;
}

View File

@ -454,10 +454,10 @@ module.exports = (_ => {
closeAllFolders: {value: false, description: "Closes all Folders when selecting a Server"},
forceOpenFolder: {value: false, description: "Forces a Folder to open when switching to a Server of that Folder"},
showCountBadge: {value: true, description: "Displays Badge for Amount of Servers in a Folder"},
addFolderBackground: {value: false, description: "Adds a Folder Background behind a Group of Servers"},
extraColumn: {value: true, description: "Moves the Servers from opened Folders into an extra Column"},
addSeparators: {value: true, description: "Adds Separators between Servers of different Folders in extra Column"},
addFolderIcon: {value: false, description: "Adds the Folder Icon on the top of the Server List in the extra Column"},
addFolderBackground: {value: false, description: "Adds a Folder Background behind a Group of Servers in the extra Column"}
addFolderIcon: {value: false, description: "Adds the Folder Icon on the top of the Server List in the extra Column"}
}
};
@ -471,6 +471,7 @@ module.exports = (_ => {
],
after: [
"FolderHeader",
"FolderItemWrapper",
"FolderSettingsModal",
"GuildItem",
"GuildsBar"
@ -769,6 +770,15 @@ module.exports = (_ => {
folderStates[e.instance.props.folderNode.id] = state;
}
processFolderItemWrapper (e) {
if (!e.instance.props.folderNode && e.returnvalue.props.style["--folder-color"]) return;
let folderColor = this.settings.general.addFolderBackground && BDFDB.LibraryStores.ExpandedGuildFolderStore.isFolderExpanded(e.instance.props.folderNode.id) && (BDFDB.ColorUtils.convert(e.instance.props.folderNode.color, "HEX") || BDFDB.ColorUtils.convert(BDFDB.DiscordConstants.Colors.BRAND, "RGB"));
if (folderColor) e.returnvalue = BDFDB.ReactUtils.createElement("div", {
style: {"--folder-color": folderColor},
children: e.returnvalue
});
}
processFolderHeader (e) {
if (!e.instance.props.folderNode) return;
let data = this.getFolderConfig(e.instance.props.folderNode.id);