@@ -21,12 +21,19 @@ export default function SettingsUi() {
|
||||
Button
|
||||
} = Common;
|
||||
|
||||
const switches: [keyof typeof Settings, string, string, boolean?][] = [
|
||||
const switches: [keyof typeof Settings, string, string, boolean?, (() => boolean)?][] = [
|
||||
[
|
||||
"tray",
|
||||
"Tray Icon",
|
||||
"Add a tray icon for Vencord Desktop",
|
||||
true
|
||||
],
|
||||
[
|
||||
"minimizeToTray",
|
||||
"Minimize to tray",
|
||||
"Hitting X will make Vencord Desktop minimize to the tray instead of closing",
|
||||
true
|
||||
true,
|
||||
() => Settings["tray"] ?? true
|
||||
],
|
||||
[
|
||||
"disableMinSize",
|
||||
@@ -62,9 +69,10 @@ export default function SettingsUi() {
|
||||
|
||||
<FormDivider className={Margins.top16 + " " + Margins.bottom16} />
|
||||
|
||||
{switches.map(([key, text, note, def]) => (
|
||||
{switches.map(([key, text, note, def, predicate]) => (
|
||||
<FormSwitch
|
||||
value={Settings[key] ?? def ?? false}
|
||||
value={(Settings[key] ?? def ?? false) && (!predicate || predicate())}
|
||||
disabled={predicate && !predicate()}
|
||||
onChange={v => (Settings[key] = v)}
|
||||
note={note}
|
||||
key={key}
|
||||
|
||||
Reference in New Issue
Block a user