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

+8 -6
View File
@@ -171,13 +171,15 @@ const LONG_PRESS_ESCAPE_MENU_MS = 4000;
class ShellOverlayMenuLayer extends MenuLayer {
constructor(items: MenuItem[], private readonly onClosed: () => void) {
// Aligned to the min-height window band (like the sidebar), wherever the
// vertical position setting currently puts it; past the sidebar strip
// where one reserves width (none in the full-panel mode).
super(null, items, {
x: sidebarWidth() + 8,
// vertical position setting currently puts it; centered over the
// application area, i.e. the part of the screen past the sidebar strip
// (the whole screen in the full-panel mode, where the strip overlays).
const width = 272;
super("System", items, {
x: sidebarWidth() + (((G2_LENS_WIDTH - sidebarWidth() - width) / 2) | 0),
y: minWindowTop() + TOP_BAR_HEIGHT + 8,
width: 272,
minHeight: 0,
width,
minHeight: 150,
});
}