desktop: use native-height Windows and Linux controls

This commit is contained in:
amosblomqvist
2026-10-12 09:46:42 +03:00
parent 0540bf697c
commit a395f37727
2 changed files with 8 additions and 5 deletions
+5 -3
View File
@@ -262,9 +262,11 @@ function createWindow(url) {
? { titleBarStyle: "hiddenInset", trafficLightPosition: { x: 16, y: 22.5 } } ? { titleBarStyle: "hiddenInset", trafficLightPosition: { x: 16, y: 22.5 } }
: { : {
titleBarStyle: "hidden", titleBarStyle: "hidden",
// Native min/max/close on the right; the renderer reserves their // Native min/max/close on the right, at the OS's compact default
// actual width via env(titlebar-area-*), not a guessed gutter. // height. Do not force the zoom-invariant native overlay to match
titleBarOverlay: { color: "#141414", symbolColor: "#e5e5e5", height: 60 }, // the renderer's 60 CSS px bar: zooming out would cover its border.
// The renderer reserves the actual width via env(titlebar-area-*).
titleBarOverlay: { color: "#141414", symbolColor: "#e5e5e5" },
// Keep the custom bar alone; Alt reveals the native menu. // Keep the custom bar alone; Alt reveals the native menu.
autoHideMenuBar: true, autoHideMenuBar: true,
}), }),
+3 -2
View File
@@ -47,10 +47,11 @@ describe("desktop window chrome", () => {
}); });
for (const platform of ["win32", "linux"]) { for (const platform of ["win32", "linux"]) {
it(`${platform} uses native right-side controls with an Alt-accessible menu`, () => { it(`${platform} uses native-height right-side controls with an Alt-accessible menu`, () => {
const options = windowOptions(platform); const options = windowOptions(platform);
assert.equal(options.titleBarStyle, "hidden"); assert.equal(options.titleBarStyle, "hidden");
assert.deepEqual(options.titleBarOverlay, { color: "#141414", symbolColor: "#e5e5e5", height: 60 }); assert.deepEqual(options.titleBarOverlay, { color: "#141414", symbolColor: "#e5e5e5" });
assert.equal(Object.hasOwn(options.titleBarOverlay, "height"), false, "omit height so the OS selects its native default");
assert.equal(options.trafficLightPosition, undefined); assert.equal(options.trafficLightPosition, undefined);
assert.equal(options.autoHideMenuBar, true); assert.equal(options.autoHideMenuBar, true);
assert.equal(options.webPreferences.contextIsolation, true); assert.equal(options.webPreferences.contextIsolation, true);