Borderless modes have different padding inside the builtin apps

Most of the builtin apps had some padding between the window edge and
their content, because they expect to be displayed with a line border on
their edge. We added a customization option to remove the border, so,
that padding is not always necessary. Make the layouts dynamically
adjust, to omit the padding when it isn't needed.
This commit is contained in:
James Babcock committed 2026-11-11 15:19:29 -08:00
1 parent e158452ba4
commit a02b849200
115 files changed
+3600 -1583

No files matched your search

+17
View File
@@ -0,0 +1,17 @@
// Viewports for layout tests: what ctx.stack.getBaseSize() (or a worker's
// open-window message) hands a layout. Needs `tsc -p tests/tsconfig.json`.
const viewport = require('../../.test-build/app/ui/viewport.js');
/** A window with a border line along every edge (a framed window): 8px of padding all round. */
const bordered = (width, height) => viewport.viewportWith({ width, height }, viewport.uniformEdges('border'));
/** A window nothing borders (Border: None, or immersive): no padding. */
const unbordered = (width, height) => viewport.viewportWith({ width, height }, viewport.uniformEdges('offscreen'));
/** A window with border lines along just the named edges, e.g. edged(576, 260, 'top', 'left'). */
const edged = (width, height, ...borders) => viewport.viewportWith({ width, height }, {
top: 'offscreen', right: 'offscreen', bottom: 'offscreen', left: 'offscreen',
...Object.fromEntries(borders.map((edge) => [edge, 'border'])),
});
module.exports = { ...viewport, bordered, unbordered, edged };