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

+4 -2
View File
@@ -4,6 +4,7 @@ import { GESTURE_LONG_PRESS, GESTURE_SHORT_THEN_LONG_PRESS, gestureHints, type I
import { type Layer, type LayerActions, LayerStack, noopLayerActions } from "./layers";
import { CONTEXT_MENU_DIM, MenuLayer, type MenuItem, type MenuLayout } from "./menu";
import type { WorkerAppReply } from "./shell/worker-window";
import type { Viewport, ViewportSize } from "./viewport";
/**
* The window context menu, opened by tap-then-hold: an app's own menu,
@@ -65,7 +66,8 @@ export type WindowMenuOptions = {
claimsLongPress?: () => boolean;
/** Paint the window content the menu draws over (a fresh, mutable image). */
paintBase: () => GrayImage;
size: { width: number; height: number };
/** The window's viewport; a bare size will do, as the menu itself floats clear of the edges. */
size: ViewportSize | Viewport;
isFocused: () => boolean;
};
@@ -92,7 +94,7 @@ export class WindowMenu {
constructor(private readonly options: WindowMenuOptions) {}
resize(size: { width: number; height: number }): void {
resize(size: ViewportSize | Viewport): void {
this.options.size = size;
this.stack?.setBaseSize(size);
}