Context menus are centered and include window title

This commit is contained in:
James Babcock committed 2026-09-01 00:58:28 -07:00
1 parent 5158bc86ff
commit b1493a353d
14 files changed
+55 -18

No files matched your search

+3
View File
@@ -64,6 +64,7 @@ const smallFont = getDefaultSmallFont();
type RoamWindow = {
windowId: string;
surfaceId: string;
title: string;
viewportWidth: number;
viewportHeight: number;
foreground: boolean;
@@ -168,6 +169,7 @@ global.onmessage = (event: { data: WorkerAppMessage }) => {
window = {
windowId: message.windowId,
surfaceId: message.surfaceId,
title: message.title,
viewportWidth: message.viewport.width,
viewportHeight: message.viewport.height,
foreground: false,
@@ -327,6 +329,7 @@ function maybeRefreshStalePage(): void {
function windowMenu(win: RoamWindow): WindowMenu {
if (!win.menu) {
win.menu = new WindowMenu({
title: () => win.title,
size: { width: win.viewportWidth, height: win.viewportHeight },
paintBase: () => paintContent(win),
isFocused: () => win.focused,