forked from Blendman974/faceclaw
Context menus are centered and include window title
This commit is contained in:
1 parent
5158bc86ff
commit
b1493a353d
14 files changed
+55
-18
No files matched your search
@@ -59,6 +59,7 @@ type MapMode = "follow" | "overview";
|
||||
type NavWindow = {
|
||||
windowId: string;
|
||||
surfaceId: string;
|
||||
title: string;
|
||||
viewportWidth: number;
|
||||
viewportHeight: number;
|
||||
foreground: boolean;
|
||||
@@ -162,6 +163,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,
|
||||
@@ -612,6 +614,7 @@ function describeRouteStatus(): string {
|
||||
function windowMenu(win: NavWindow): WindowMenu {
|
||||
if (!win.menu) {
|
||||
win.menu = new WindowMenu({
|
||||
title: () => win.title,
|
||||
size: { width: win.viewportWidth, height: win.viewportHeight },
|
||||
paintBase: () => paintContent(win),
|
||||
isFocused: () => win.focused,
|
||||
|
||||
Reference in new issue
Block a user