Add 'New Window' command

This commit is contained in:
Skyler Lehmkuhl 2025-01-16 21:48:39 -05:00
parent 7cf33494fa
commit 2d355a13b9
2 changed files with 12 additions and 1 deletions

View File

@ -1,4 +1,4 @@
use std::sync::{Arc, Mutex}; use std::sync::{Mutex};
use tauri_plugin_log::{Target, TargetKind}; use tauri_plugin_log::{Target, TargetKind};
use log::{trace, info, debug, warn, error}; use log::{trace, info, debug, warn, error};

View File

@ -354,6 +354,7 @@ let config = {
undo: "<mod>z", undo: "<mod>z",
redo: "<mod>Z", redo: "<mod>Z",
new: "<mod>n", new: "<mod>n",
newWindow: "<mod>N",
save: "<mod>s", save: "<mod>s",
saveAs: "<mod>S", saveAs: "<mod>S",
open: "<mod>o", open: "<mod>o",
@ -4369,6 +4370,10 @@ function decrementFrame() {
updateUI(); updateUI();
} }
function newWindow() {
invoke("create_window", {app: window.__TAURI__.app})
}
function _newFile(width, height, fps) { function _newFile(width, height, fps) {
root = new GraphicsObject("root"); root = new GraphicsObject("root");
context.objectStack = [root]; context.objectStack = [root];
@ -7881,6 +7886,12 @@ async function renderMenu() {
action: newFile, action: newFile,
accelerator: getShortcut("new"), accelerator: getShortcut("new"),
}, },
{
text: "New Window",
enabled: true,
action: newWindow,
accelerator: getShortcut("newWindow"),
},
{ {
text: "Save", text: "Save",
enabled: true, enabled: true,