mirror of
https://github.com/Equicord/Equicord.git
synced 2025-01-18 13:23:28 -05:00
QoL: DiscordColorways Above Serverlist
* feat(ServerListIndicator) add ids for css
* feat: consistency
* feat(SpotifyControls): dummy color control
* fix: resolve merge
* Revert "feat(SpotifyControls): dummy color control"
This reverts commit 3a38e02679
.
* fix(ServerListIndicators): tooltip changes on mode
* fix(SpotifyControls): copy paste from source to sync
* fix: edit DiscordColorways to ServerListRenderPosition.Above
* Update index.tsx
---------
Co-authored-by: thororen <78185467+thororen1234@users.noreply.github.com>
This commit is contained in:
parent
d9381afaa2
commit
67d3d7da19
3 changed files with 16 additions and 14 deletions
|
@ -250,7 +250,7 @@ export default definePlugin({
|
|||
|
||||
customSettingsSections.push(ColorwaysSelector, ColorwaysSettings, ColorwaysSourceManager, ColorwaysOnDemand, ColorwaysStore);
|
||||
|
||||
addServerListElement(ServerListRenderPosition.In, this.ColorwaysButton);
|
||||
addServerListElement(ServerListRenderPosition.Above, this.ColorwaysButton);
|
||||
|
||||
enableStyle(style);
|
||||
ColorwayCSS.set((await DataStore.get("activeColorwayObject") as ColorwayObject).css || "");
|
||||
|
|
|
@ -16,17 +16,16 @@
|
|||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import "./styles.css";
|
||||
|
||||
import { addServerListElement, removeServerListElement, ServerListRenderPosition } from "@api/ServerList";
|
||||
import { Settings } from "@api/Settings";
|
||||
import { enableStyle } from "@api/Styles";
|
||||
import ErrorBoundary from "@components/ErrorBoundary";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import { useForceUpdater } from "@utils/react";
|
||||
import definePlugin, { OptionType } from "@utils/types";
|
||||
import { GuildStore, PresenceStore, RelationshipStore, Tooltip } from "@webpack/common";
|
||||
|
||||
import style from "./styles.css?managed";
|
||||
|
||||
const enum IndicatorType {
|
||||
SERVER = 1 << 0,
|
||||
FRIEND = 1 << 1,
|
||||
|
@ -128,15 +127,19 @@ export default definePlugin({
|
|||
|
||||
renderIndicator: () => {
|
||||
const { mode } = Settings.plugins.ServerListIndicators;
|
||||
let text;
|
||||
|
||||
if (!!(mode & IndicatorType.FRIEND) && !!(mode & IndicatorType.SERVER)) {
|
||||
text = `${onlineFriends} Friends, ${guildCount} Servers`;
|
||||
} else if (!!(mode & IndicatorType.FRIEND)) {
|
||||
text = `${onlineFriends} Friends`;
|
||||
} else if (!!(mode & IndicatorType.SERVER)) {
|
||||
text = `${guildCount} Servers`;
|
||||
let text: string = `${onlineFriends} Friends, ${guildCount} Servers`;
|
||||
switch (mode) {
|
||||
case (!!(mode & IndicatorType.FRIEND)):
|
||||
text = `${onlineFriends} Friends`;
|
||||
break;
|
||||
case (!!(mode & IndicatorType.SERVER)):
|
||||
text = `${guildCount} Servers`;
|
||||
break;
|
||||
case (!!(mode & IndicatorType.FRIEND)) && (!!(mode & IndicatorType.SERVER)):
|
||||
text = `${onlineFriends} Friends, ${guildCount} Servers`;
|
||||
break;
|
||||
}
|
||||
|
||||
return <ErrorBoundary noop>
|
||||
<div id="vc-indicators-container">
|
||||
<Tooltip text={text} position="right">
|
||||
|
@ -163,7 +166,6 @@ export default definePlugin({
|
|||
|
||||
start() {
|
||||
addServerListElement(ServerListRenderPosition.Above, this.renderIndicator);
|
||||
enableStyle(style);
|
||||
handlePresenceUpdate();
|
||||
handleGuildUpdate();
|
||||
},
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
#vc-serverlist-indicators:hover {
|
||||
border-radius: 34%;
|
||||
background-color: var(--brand-500);
|
||||
background-color: var(--brand-experiment);
|
||||
}
|
||||
|
||||
#vc-serverlist-indicators::before {
|
||||
|
|
Loading…
Reference in a new issue