Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat(desktop): add auto-zoom scaling for high-DPI displays #406

ClosedSuperComboGamer(GitHub profile, opens in a new tab)wants to merge 15 commits intomain fromrefs/pull/406/headopened View on GitHub

Showing 1 changed file with 191 additions and 9 deletions.

x
0 of 1 viewed, 1 left
191 additions and 9 deletionsapps/desktop/src/main.tsModified
View file
@@ -3,7 +3,6 @@
import * as FS from "node:fs";
import * as OS from "node:os";
import * as Path from "node:path";
-​
import {
app,
BrowserWindow,
@@ -13,6 +12,7 @@
nativeImage,
nativeTheme,
protocol,
+ screen,
shell,
} from "electron";
import type { MenuItemConstructorOptions } from "electron";
@@ -75,6 +75,48 @@
const AUTO_UPDATE_POLL_INTERVAL_MS = 4 * 60 * 60 * 1000;
const DESKTOP_UPDATE_CHANNEL = "latest";
const DESKTOP_UPDATE_ALLOW_PRERELEASE = false;
+const BASE_DEFAULT_WIDTH = 1100;
+const BASE_DEFAULT_HEIGHT = 780;
+const BASE_MIN_WIDTH = 840;
+const BASE_MIN_HEIGHT = 620;
+const REFERENCE_SHORT_EDGE = 1080;
+const ZOOM_STEP = 0.25;
+const MIN_ZOOM_FACTOR = 0.5;
+const MAX_ZOOM_FACTOR = 3.0;