mirror of
https://github.com/Lightcord/Lightcord.git
synced 2025-04-12 00:55:40 +02:00
Glasstron clarification + option to disable it
This commit is contained in:
parent
8e546f2914
commit
2ff7a5cea8
File diff suppressed because one or more lines are too long
2
BetterDiscordApp/js/main.min.js
vendored
2
BetterDiscordApp/js/main.min.js
vendored
File diff suppressed because one or more lines are too long
@ -44,7 +44,7 @@ export const bbdChangelog = {
|
|||||||
title: "What's New?",
|
title: "What's New?",
|
||||||
items: [
|
items: [
|
||||||
"**Lightcord** is now using BandagedBD. That means all plugins you were using can be used too !",
|
"**Lightcord** is now using BandagedBD. That means all plugins you were using can be used too !",
|
||||||
"**Window Transparency** changes were made to more compatible with external window managers and addons like Glasscord.",
|
"**Window Transparency** changes were made to more compatible with external window managers and addons like Glasstron.",
|
||||||
"Initialization sequence has once again been changed slightly to hopefully improve loading times."
|
"Initialization sequence has once again been changed slightly to hopefully improve loading times."
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
@ -95,11 +95,12 @@ export const settings = {
|
|||||||
"Ad Block": {id: "lightcord-4", info: "Block any BOT that dms you with an invite link. Even in an embed.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
"Ad Block": {id: "lightcord-4", info: "Block any BOT that dms you with an invite link. Even in an embed.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
||||||
"Enable Lightcord Servers": {id: "lightcord-5", info: "Enable Lightcord's servers. Disabling this will disable custom badges.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
"Enable Lightcord Servers": {id: "lightcord-5", info: "Enable Lightcord's servers. Disabling this will disable custom badges.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
||||||
"Disable typing": {id: "lightcord-7", info: "Don't let other see you're typing.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
"Disable typing": {id: "lightcord-7", info: "Don't let other see you're typing.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
||||||
"Lightcord Tabs": {id: "lightcord-8", info: "Allows you to launch multiple instances of Lightcord in the same window (EXPERIMENTAL).", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord"},
|
"Lightcord Tabs": {id: "lightcord-8", info: "Allows you to launch multiple instances of Lightcord in the same window.", implemented: true, hidden: false, cat: "lightcord", category: "Lightcord", experimental: true},
|
||||||
"No Window Bounds": {id: "no_window_bound", info: "Disable Window Bounds. Can be useful if you use a window manager.", implemented: true, hidden: process.platform == "linux", cat: "lightcord", category: "Lightcord"},
|
|
||||||
|
|
||||||
/** Lightcord Window */
|
/** Lightcord Window */
|
||||||
"Always-on-Top": {id: "lightcord-3", info: "Enable window's Always-on-Top mode, where Lightcord stays on top of other applications.", implemented: true, hidden: false, cat: "lightcord", category: "Window"},
|
"Always-on-Top": {id: "lightcord-3", info: "Enable the window's Always-on-Top mode, where Lightcord stays on top of other applications.", implemented: true, hidden: false, cat: "lightcord", category: "Window"},
|
||||||
|
"No Window Bounds": {id: "no_window_bound", info: "Disable Window Bounds. Can be useful if you use a window manager.", implemented: true, hidden: process.platform !== "linux", cat: "lightcord", category: "Window"},
|
||||||
|
"Enable Glasstron": {id: "enable_glasstron", info: "Enable Glasstron. If you're not using transparent themes, this can reduce lag.", implemented: true, hidden: false, cat: "lightcord", category: "Window"},
|
||||||
|
|
||||||
/** RichPresence */
|
/** RichPresence */
|
||||||
"Enable": {id: "lightcord-presence-1", info: "Enable RichPresence below.", implemented: true, hidden: false, cat: "status"}
|
"Enable": {id: "lightcord-presence-1", info: "Enable RichPresence below.", implemented: true, hidden: false, cat: "status"}
|
||||||
|
@ -139,16 +139,8 @@ class LightcordError extends Error {
|
|||||||
|
|
||||||
export const Constants = {
|
export const Constants = {
|
||||||
SERVER_URL: "https://lightcord.deroku.xyz",
|
SERVER_URL: "https://lightcord.deroku.xyz",
|
||||||
badges: [ // TODO:
|
badges: [ // TODO: Add more badges + server side svg
|
||||||
/*{
|
{
|
||||||
name: "Lightcord User",
|
|
||||||
id: "01cfa7b0-7cdb-4b0e-8258-9c6a78235c93",
|
|
||||||
defaultUsers: [],
|
|
||||||
scopes: [
|
|
||||||
"user"
|
|
||||||
],
|
|
||||||
component: LightcordUserBadge
|
|
||||||
}, */{
|
|
||||||
name: "Lightcord Bug Hunter",
|
name: "Lightcord Bug Hunter",
|
||||||
id: "f04698f5-816b-41e3-bd01-92291193d7a5",
|
id: "f04698f5-816b-41e3-bd01-92291193d7a5",
|
||||||
defaultUsers: [
|
defaultUsers: [
|
||||||
|
@ -142,7 +142,7 @@ export default new class V2_SettingsPanel {
|
|||||||
}
|
}
|
||||||
|
|
||||||
updateSettings(id, enabled, sidebar) {
|
updateSettings(id, enabled, sidebar) {
|
||||||
if(!["lightcord-8", "no_window_bound"].includes(id))settingsCookie[id] = enabled;
|
if(!["lightcord-8", "no_window_bound", "enable_glasstron"].includes(id))settingsCookie[id] = enabled;
|
||||||
|
|
||||||
if (id == "bda-gs-2") {
|
if (id == "bda-gs-2") {
|
||||||
if (enabled) DOM.addClass(document.body, "bd-minimal");
|
if (enabled) DOM.addClass(document.body, "bd-minimal");
|
||||||
@ -273,6 +273,13 @@ export default new class V2_SettingsPanel {
|
|||||||
remote.app.relaunch()
|
remote.app.relaunch()
|
||||||
remote.app.exit()
|
remote.app.exit()
|
||||||
}
|
}
|
||||||
|
if (id === "enable_glasstron"){
|
||||||
|
let appSettings = remote.getGlobal("appSettings")
|
||||||
|
appSettings.set("GLASSTRON", enabled)
|
||||||
|
appSettings.save()
|
||||||
|
remote.app.relaunch()
|
||||||
|
remote.app.exit()
|
||||||
|
}
|
||||||
|
|
||||||
this.saveSettings();
|
this.saveSettings();
|
||||||
}
|
}
|
||||||
@ -335,10 +342,11 @@ export default new class V2_SettingsPanel {
|
|||||||
let isChecked = settingsCookie[setting.id]
|
let isChecked = settingsCookie[setting.id]
|
||||||
if(setting.id === "lightcord-8")isChecked = appSettings.get("isTabs", false);
|
if(setting.id === "lightcord-8")isChecked = appSettings.get("isTabs", false);
|
||||||
if(setting.id === "no_window_bound")isChecked = appSettings.get("NO_WINDOWS_BOUND", false)
|
if(setting.id === "no_window_bound")isChecked = appSettings.get("NO_WINDOWS_BOUND", false)
|
||||||
|
if(setting.id === "enable_glasstron")isChecked = appSettings.get("GLASSTRON", true)
|
||||||
let returnValue = BDV2.react.createElement(Switch, {id: setting.id, key: setting.id, data: setting, checked: isChecked, onChange: (id, checked) => {
|
let returnValue = BDV2.react.createElement(Switch, {id: setting.id, key: setting.id, data: setting, checked: isChecked, onChange: (id, checked) => {
|
||||||
this.onChange(id, checked, sidebar);
|
this.onChange(id, checked, sidebar);
|
||||||
}})
|
}})
|
||||||
if(setting.id !== "lightcord-8" || !isChecked)return returnValue
|
if(setting.id == "lightcord-8" && isChecked){
|
||||||
return [
|
return [
|
||||||
returnValue,
|
returnValue,
|
||||||
React.createElement(Lightcord.Api.Components.inputs.Button, {
|
React.createElement(Lightcord.Api.Components.inputs.Button, {
|
||||||
@ -353,6 +361,8 @@ export default new class V2_SettingsPanel {
|
|||||||
disabled: false
|
disabled: false
|
||||||
}, "Open a new Tab")
|
}, "Open a new Tab")
|
||||||
]
|
]
|
||||||
|
}
|
||||||
|
return returnValue
|
||||||
})
|
})
|
||||||
]
|
]
|
||||||
}),
|
}),
|
||||||
|
@ -1,6 +1,15 @@
|
|||||||
import BDV2 from "../modules/v2";
|
import BDV2 from "../modules/v2";
|
||||||
import Switch from "./components/switch";
|
import Switch from "./components/switch";
|
||||||
|
|
||||||
|
let classnames = []
|
||||||
|
function getClassName(name){
|
||||||
|
let className = classnames.find(e => e.startsWith(name+"-"))
|
||||||
|
if(className)return className
|
||||||
|
className = BDModules.get(e => e.name)[0]
|
||||||
|
classnames.push(className)
|
||||||
|
return className
|
||||||
|
}
|
||||||
|
|
||||||
export default class SwitchItem extends BDV2.reactComponent {
|
export default class SwitchItem extends BDV2.reactComponent {
|
||||||
|
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
@ -14,7 +23,16 @@ export default class SwitchItem extends BDV2.reactComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {text, info} = this.props.data;
|
let {text, info} = this.props.data;
|
||||||
|
if(!classnames.find(e => e.startsWith("beta-"))){
|
||||||
|
classnames.push(BDModules.get(e => e.beta && (!e.container && !e.userSettingsVoice))[0].beta)
|
||||||
|
}
|
||||||
|
if(this.props.data.experimental){
|
||||||
|
info = [
|
||||||
|
info,
|
||||||
|
React.createElement("sup", {className: getClassName("beta")}, "(EXPERIMENTAL)")
|
||||||
|
]
|
||||||
|
}
|
||||||
return BDV2.react.createElement("div", {className: "ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item"},
|
return BDV2.react.createElement("div", {className: "ui-flex flex-vertical flex-justify-start flex-align-stretch flex-nowrap ui-switch-item"},
|
||||||
BDV2.react.createElement("div", {className: "ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap"},
|
BDV2.react.createElement("div", {className: "ui-flex flex-horizontal flex-justify-start flex-align-stretch flex-nowrap"},
|
||||||
BDV2.react.createElement("h3", {className: "ui-form-title h3 margin-reset margin-reset ui-flex-child"}, text),
|
BDV2.react.createElement("h3", {className: "ui-form-title h3 margin-reset margin-reset ui-flex-child"}, text),
|
||||||
|
@ -374,11 +374,13 @@ function launchMainAppWindow(isVisible) {
|
|||||||
mainWindow = new electron.BrowserWindow(mainWindowOptions);
|
mainWindow = new electron.BrowserWindow(mainWindowOptions);
|
||||||
mainWindowId = mainWindow.id;
|
mainWindowId = mainWindow.id;
|
||||||
global.mainWindowId = mainWindowId;
|
global.mainWindowId = mainWindowId;
|
||||||
|
if(settings.get("GLASSTRON", true)){
|
||||||
glasstron.update(mainWindow, {
|
glasstron.update(mainWindow, {
|
||||||
windows: {blurType: 'blurbehind'},
|
windows: {blurType: 'blurbehind'},
|
||||||
macos: {vibrancy: 'fullscreen-ui'},
|
macos: {vibrancy: 'fullscreen-ui'},
|
||||||
linux: {requestBlur: true} // KWin
|
linux: {requestBlur: true} // KWin
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
mainWindow.webContents.session.webRequest.onHeadersReceived(function(details, callback) {
|
mainWindow.webContents.session.webRequest.onHeadersReceived(function(details, callback) {
|
||||||
if (!details.responseHeaders["content-security-policy-report-only"] && !details.responseHeaders["content-security-policy"]) return callback({cancel: false});
|
if (!details.responseHeaders["content-security-policy-report-only"] && !details.responseHeaders["content-security-policy"]) return callback({cancel: false});
|
||||||
@ -434,8 +436,6 @@ function launchMainAppWindow(isVisible) {
|
|||||||
insideAuthFlow = false;
|
insideAuthFlow = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`Emitting focus as ready`)
|
|
||||||
|
|
||||||
webContentsSend(mainWindow != null && mainWindow.isFocused() ? 'MAIN_WINDOW_FOCUS' : 'MAIN_WINDOW_BLUR');
|
webContentsSend(mainWindow != null && mainWindow.isFocused() ? 'MAIN_WINDOW_FOCUS' : 'MAIN_WINDOW_BLUR');
|
||||||
|
|
||||||
if (!lastPageLoadFailed) {
|
if (!lastPageLoadFailed) {
|
||||||
|
11
src/index.ts
11
src/index.ts
@ -1,11 +1,16 @@
|
|||||||
|
/** settings */
|
||||||
|
import appSettings from "./appSettings"
|
||||||
|
let settings = appSettings.getSettings()
|
||||||
|
|
||||||
/** Glasstron */
|
/** Glasstron */
|
||||||
import * as glasstron from "glasstron"
|
if(settings.get("GLASSTRON", true)){
|
||||||
glasstron.init()
|
const glasstron = require("glasstron")
|
||||||
|
glasstron.init()
|
||||||
|
}
|
||||||
|
|
||||||
/** Modules */
|
/** Modules */
|
||||||
import * as electron from "electron"
|
import * as electron from "electron"
|
||||||
import requireNativeDiscordModule from "./requireNative";
|
import requireNativeDiscordModule from "./requireNative";
|
||||||
import appSettings from "./appSettings"
|
|
||||||
import autoStart from "./autoStart"
|
import autoStart from "./autoStart"
|
||||||
import * as buildInfo from "./buildInfo"
|
import * as buildInfo from "./buildInfo"
|
||||||
import * as Constants from "./Constants"
|
import * as Constants from "./Constants"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user