Skip to content

Commit

Permalink
Add desktop context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
BomberFish committed Dec 2, 2024
1 parent 4a7698f commit 351a948
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Boot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -633,9 +633,23 @@ document.addEventListener("anura-login-completed", async () => {
});
}

const desktopCtx = new ContextMenu(true); // we are init'ing before anura so this is needed

desktopCtx.addItem(
"Set wallpaper",
() => {
// this however will execute after anura is init'ed
anura.apps["anura.wallpaper"].open();
},
"wallpaper",
);

document.addEventListener("contextmenu", function (e) {
if (e.shiftKey) return;
e.preventDefault();
if (e.target === document.body) {
desktopCtx.show(e.clientX, e.clientY);
}
});

document.addEventListener("keydown", (e) => {
Expand Down

0 comments on commit 351a948

Please sign in to comment.