SHC: show active now voice members; PermViewer: improve styling (#1314)
This commit is contained in:
parent
ab811470fc
commit
9820b79dfe
@ -23,6 +23,7 @@ import { ModalCloseButton, ModalContent, ModalHeader, ModalProps, ModalRoot, Mod
|
|||||||
import { ContextMenu, FluxDispatcher, GuildMemberStore, Menu, PermissionsBits, Text, Tooltip, useEffect, UserStore, useState, useStateFromStores } from "@webpack/common";
|
import { ContextMenu, FluxDispatcher, GuildMemberStore, Menu, PermissionsBits, Text, Tooltip, useEffect, UserStore, useState, useStateFromStores } from "@webpack/common";
|
||||||
import type { Guild } from "discord-types/general";
|
import type { Guild } from "discord-types/general";
|
||||||
|
|
||||||
|
import { settings } from "..";
|
||||||
import { cl, getPermissionDescription, getPermissionString } from "../utils";
|
import { cl, getPermissionDescription, getPermissionString } from "../utils";
|
||||||
import { PermissionAllowedIcon, PermissionDefaultIcon, PermissionDeniedIcon } from "./icons";
|
import { PermissionAllowedIcon, PermissionDefaultIcon, PermissionDeniedIcon } from "./icons";
|
||||||
|
|
||||||
@ -108,7 +109,7 @@ function RolesAndUsersPermissionsComponent({ permissions, guild, modalProps, hea
|
|||||||
<div
|
<div
|
||||||
className={cl("perms-list-item", { "perms-list-item-active": selectedItemIndex === index })}
|
className={cl("perms-list-item", { "perms-list-item-active": selectedItemIndex === index })}
|
||||||
onContextMenu={e => {
|
onContextMenu={e => {
|
||||||
if (permission.type === PermissionType.Role)
|
if ((settings.store as any).unsafeViewAsRole && permission.type === PermissionType.Role)
|
||||||
ContextMenu.open(e, () => (
|
ContextMenu.open(e, () => (
|
||||||
<RoleContextMenu
|
<RoleContextMenu
|
||||||
guild={guild}
|
guild={guild}
|
||||||
|
@ -63,6 +63,7 @@
|
|||||||
grid-area: list;
|
grid-area: list;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
gap: 2px;
|
||||||
border-right: 2px solid var(--background-modifier-active);
|
border-right: 2px solid var(--background-modifier-active);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,6 +78,15 @@
|
|||||||
padding: 8px 5px;
|
padding: 8px 5px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
width: 230px;
|
width: 230px;
|
||||||
|
border-radius: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-permviewer-perms-list-item:hover {
|
||||||
|
background-color: var(--background-modifier-hover);
|
||||||
|
}
|
||||||
|
|
||||||
|
.vc-permviewer-perms-list-item-active {
|
||||||
|
background-color: var(--background-modifier-selected);
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-permviewer-perms-list-item > div {
|
.vc-permviewer-perms-list-item > div {
|
||||||
@ -85,11 +95,6 @@
|
|||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
.vc-permviewer-perms-list-item-active {
|
|
||||||
background-color: var(--background-modifier-selected);
|
|
||||||
border-radius: 5px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.vc-permviewer-perms-role-circle {
|
.vc-permviewer-perms-role-circle {
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
width: 12px;
|
width: 12px;
|
||||||
|
@ -419,6 +419,14 @@ export default definePlugin({
|
|||||||
match: /(?<=getChannels\(\i)(?=\))/,
|
match: /(?<=getChannels\(\i)(?=\))/,
|
||||||
replace: ",true"
|
replace: ",true"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
find: '.displayName="NowPlayingViewStore"',
|
||||||
|
replacement: {
|
||||||
|
// Make active now voice states on hiddenl channels
|
||||||
|
match: /(getVoiceStateForUser.{0,150}?)&&\i\.\i\.canWithPartialContext.{0,20}VIEW_CHANNEL.+?}\)(?=\?)/,
|
||||||
|
replace: "$1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user