From 9f2323c67ec1737b0eb149289aabef29f70b4e14 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Wed, 15 Jul 2026 22:33:20 -0400 Subject: [PATCH] move some managed css around --- .../bannersEverywhere/index.tsx | 4 +- src/equicordplugins/fullVcPfp/index.tsx | 9 +---- src/equicordplugins/remix/index.tsx | 10 +---- src/equicordplugins/sidebarChat/index.tsx | 37 +++++++++---------- 4 files changed, 22 insertions(+), 38 deletions(-) diff --git a/src/equicordplugins/bannersEverywhere/index.tsx b/src/equicordplugins/bannersEverywhere/index.tsx index 6aea3cfe6..afb5e0eb9 100644 --- a/src/equicordplugins/bannersEverywhere/index.tsx +++ b/src/equicordplugins/bannersEverywhere/index.tsx @@ -7,7 +7,6 @@ import * as DataStore from "@api/DataStore"; import { isPluginEnabled } from "@api/PluginManager"; import { definePluginSettings } from "@api/Settings"; -import { disableStyle, enableStyle } from "@api/Styles"; import usrbg from "@plugins/usrbg"; import { Devs } from "@utils/constants"; import definePlugin, { OptionType } from "@utils/types"; @@ -73,14 +72,13 @@ export default definePlugin({ ], data: {}, + managedStyle: style, async start() { - enableStyle(style); this.data = await DataStore.get(DATASTORE_KEY) || {}; }, stop() { - disableStyle(style); DataStore.set(DATASTORE_KEY, this.data); }, diff --git a/src/equicordplugins/fullVcPfp/index.tsx b/src/equicordplugins/fullVcPfp/index.tsx index 8fa79df70..193934e66 100644 --- a/src/equicordplugins/fullVcPfp/index.tsx +++ b/src/equicordplugins/fullVcPfp/index.tsx @@ -4,7 +4,6 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import { disableStyle, enableStyle } from "@api/Styles"; import { EquicordDevs } from "@utils/constants"; import { getUserAvatarUrl } from "@utils/misc"; import definePlugin from "@utils/types"; @@ -17,6 +16,7 @@ export default definePlugin({ description: "Makes avatars take up the entire vc tile", tags: ["Appearance", "Voice"], authors: [EquicordDevs.mochienya], + managedStyle: style, patches: [ { find: "\"data-selenium-video-tile\":", @@ -44,11 +44,4 @@ export default definePlugin({ "--full-res-avatar": `url(${avatarUrl})` }; }, - - start() { - enableStyle(style); - }, - stop() { - disableStyle(style); - }, }); diff --git a/src/equicordplugins/remix/index.tsx b/src/equicordplugins/remix/index.tsx index 23d1042c1..514b4dbbc 100644 --- a/src/equicordplugins/remix/index.tsx +++ b/src/equicordplugins/remix/index.tsx @@ -5,12 +5,11 @@ */ import { findGroupChildrenByChildId, NavContextMenuPatchCallback } from "@api/ContextMenu"; -import { disableStyle, enableStyle } from "@api/Styles"; import { PaintbrushIcon } from "@components/Icons"; import { EquicordDevs } from "@utils/constants"; import definePlugin from "@utils/types"; import { extractAndLoadChunksLazy } from "@webpack"; -import { ChannelStore, closeModal, DraftType, FluxDispatcher, Menu, openModal,PendingReplyStore, SelectedChannelStore, UploadHandler } from "@webpack/common"; +import { ChannelStore, closeModal, DraftType, FluxDispatcher, Menu, openModal, PendingReplyStore, SelectedChannelStore, UploadHandler } from "@webpack/common"; import RemixModal from "./RemixModal"; import css from "./styles.css?managed"; @@ -76,15 +75,10 @@ export default definePlugin({ "channel-attach": UploadContextMenuPatch, "message": MessageContextMenuPatch, }, + managedStyle: css, async start() { await requireCreateStickerModal(); await requireSettingsMenu(); - - enableStyle(css); - }, - - stop() { - disableStyle(css); }, }); diff --git a/src/equicordplugins/sidebarChat/index.tsx b/src/equicordplugins/sidebarChat/index.tsx index 69c5e51a4..45b0cc34e 100644 --- a/src/equicordplugins/sidebarChat/index.tsx +++ b/src/equicordplugins/sidebarChat/index.tsx @@ -4,8 +4,6 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ -import "./styles.css"; - import { NavContextMenuPatchCallback } from "@api/ContextMenu"; import { HeaderBarButton } from "@api/HeaderBar"; import ErrorBoundary from "@components/ErrorBoundary"; @@ -47,6 +45,7 @@ import { } from "@webpack/common"; import { getOpenPopoutWindowKeys, getPersistedPopoutChannelIds, getPopoutWindowKey, isPopoutWindowOpen, settings, SidebarStore, syncPersistedPopoutWindows } from "./store"; +import style from "./style.css?managed"; const cl = classNameFactory("vc-sidebar-chat-"); @@ -324,6 +323,23 @@ export default definePlugin({ ], }, ], + managedStyle: style, + settings, + contextMenus: { + "user-context": UserContextPatch, + "channel-context": ChannelContextPatch, + "thread-context": ChannelContextPatch, + "gdm-context": ChannelContextPatch, + }, + + toolboxActions: { + "Open Previous Chat"() { + FluxDispatcher.dispatch({ + // @ts-ignore + type: "VC_SIDEBAR_CHAT_PREVIOUS", + }); + } + }, headerBarButton: { icon: WindowLaunchIcon, @@ -347,23 +363,6 @@ export default definePlugin({ restorePersistedPopouts(); }, - settings, - contextMenus: { - "user-context": UserContextPatch, - "channel-context": ChannelContextPatch, - "thread-context": ChannelContextPatch, - "gdm-context": ChannelContextPatch, - }, - - toolboxActions: { - "Open Previous Chat"() { - FluxDispatcher.dispatch({ - // @ts-ignore - type: "VC_SIDEBAR_CHAT_PREVIOUS", - }); - } - }, - renderSidebar() { const { guild, channel /* width*/ } = useStateFromStores( [SidebarStore, GuildStore, ChannelStore], () => {