WindowsTitleBar: Fix Not Disabling Discords TitleBar

This commit is contained in:
thororen1234 2026-04-17 18:27:29 -04:00
parent 5117481a73
commit 932457a217
No known key found for this signature in database
2 changed files with 37 additions and 3 deletions

View file

@ -27,7 +27,7 @@ import { classNameFactory } from "@utils/css";
import { Margins } from "@utils/margins";
import { identity, isAnyPluginDev } from "@utils/misc";
import { relaunch } from "@utils/native";
import { GuildMemberStore, React, Select, UserStore } from "@webpack/common";
import { Alerts, GuildMemberStore, React, Select, UserStore } from "@webpack/common";
import { DonateButtonComponent } from "./DonateButton";
import { openNotificationSettingsModal } from "./NotificationSettings";
@ -249,7 +249,19 @@ function EquicordSettings() {
<FormSwitch
key={s.key}
value={settings[s.key]}
onChange={v => (settings[s.key] = v)}
onChange={v => {
settings[s.key] = v;
if (s.restartRequired) {
Alerts.show({
title: "Restart Required",
body: "A restart is required to apply this change",
confirmText: "Restart now",
cancelText: "Later!",
onConfirm: relaunch
});
}
}}
title={s.title}
description={
s.warning.enabled ? (

View file

@ -8,7 +8,7 @@ import { ApplicationCommandInputType, sendBotMessage } from "@api/Commands";
import { HeaderBarButton } from "@api/HeaderBar";
import { addMessagePreSendListener, removeMessagePreSendListener } from "@api/MessageEvents";
import { isPluginEnabled } from "@api/PluginManager";
import { definePluginSettings, migratePluginToSettings } from "@api/Settings";
import { definePluginSettings, migratePluginToSettings, Settings } from "@api/Settings";
import customRPC from "@plugins/customRPC";
import { Devs, EquicordDevs, GUILD_ID, SUPPORT_CHANNEL_ID, SUPPORT_CHANNEL_IDS, VC_SUPPORT_CHANNEL_IDS } from "@utils/constants";
import { isAnyPluginDev } from "@utils/misc";
@ -288,6 +288,28 @@ export default definePlugin({
replace: ""
},
predicate: () => settings.store.jsonGateway
},
{
find: ".USE_OSX_NATIVE_TRAFFIC_LIGHTS",
predicate: () => Settings.winNativeTitleBar,
replacement: {
match: /case \i\.\i\.WINDOWS:/,
replace: 'case "WEB":'
},
},
{
find: '"refresh-title-bar-small"',
predicate: () => Settings.winNativeTitleBar,
replacement: [
{
match: /\i===\i\.PlatformTypes\.WINDOWS/g,
replace: "false"
},
{
match: /\i===\i\.PlatformTypes\.WEB/g,
replace: "true"
}
]
}
],
renderMessageAccessory(props) {