diff options
author | Đỗ Văn Hoài Tuân <htuan03@gmail.com> | 2023-04-08 18:41:55 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-09 03:41:55 +0200 |
commit | bfa20f2634a0f3f73a03135f9ddb9d0dfe566e88 (patch) | |
tree | 65c0a531c6b46abcd5f7e3cfc42491fc70c3355c /src | |
parent | 840da146b968b4db7616f5528f1a2b0d24e9517a (diff) | |
download | Vencord-bfa20f2634a0f3f73a03135f9ddb9d0dfe566e88.tar.gz Vencord-bfa20f2634a0f3f73a03135f9ddb9d0dfe566e88.tar.bz2 Vencord-bfa20f2634a0f3f73a03135f9ddb9d0dfe566e88.zip |
feat(setting): Disable minimum window size #834 (#848)
Diffstat (limited to 'src')
-rw-r--r-- | src/api/settings.ts | 2 | ||||
-rw-r--r-- | src/components/VencordSettings/VencordTab.tsx | 5 | ||||
-rw-r--r-- | src/main/patcher.ts | 15 |
3 files changed, 18 insertions, 4 deletions
diff --git a/src/api/settings.ts b/src/api/settings.ts index 8a7d9ff..b88b9f0 100644 --- a/src/api/settings.ts +++ b/src/api/settings.ts @@ -38,6 +38,7 @@ export interface Settings { frameless: boolean; transparent: boolean; winCtrlQ: boolean; + disableMinSize: boolean; winNativeTitleBar: boolean; plugins: { [plugin: string]: { @@ -71,6 +72,7 @@ const DefaultSettings: Settings = { frameless: false, transparent: false, winCtrlQ: false, + disableMinSize: false, winNativeTitleBar: false, plugins: {}, diff --git a/src/components/VencordSettings/VencordTab.tsx b/src/components/VencordSettings/VencordTab.tsx index 3bdd9b7..d5ffa91 100644 --- a/src/components/VencordSettings/VencordTab.tsx +++ b/src/components/VencordSettings/VencordTab.tsx @@ -83,6 +83,11 @@ function VencordSettings() { key: "winCtrlQ", title: "Register Ctrl+Q as shortcut to close Discord (Alternative to Alt+F4)", note: "Requires a full restart" + }, + IS_DISCORD_DESKTOP && { + key: "disableMinSize", + title: "Disable minimum window size", + note: "Requires a full restart" } ]; diff --git a/src/main/patcher.ts b/src/main/patcher.ts index c45a299..f92a64d 100644 --- a/src/main/patcher.ts +++ b/src/main/patcher.ts @@ -106,10 +106,17 @@ if (!IS_VANILLA) { BrowserWindow }; - // Patch appSettings to force enable devtools - onceDefined(global, "appSettings", s => - s.set("DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING", true) - ); + // Patch appSettings to force enable devtools and optionally disable min size + onceDefined(global, "appSettings", s => { + s.set("DANGEROUS_ENABLE_DEVTOOLS_ONLY_ENABLE_IF_YOU_KNOW_WHAT_YOURE_DOING", true); + if (settings.disableMinSize) { + s.set("MIN_WIDTH", 0); + s.set("MIN_HEIGHT", 0); + } else { + s.set("MIN_WIDTH", 940); + s.set("MIN_HEIGHT", 500); + } + }); process.env.DATA_DIR = join(app.getPath("userData"), "..", "Vencord"); } else { |