Add 'New Window' command
This commit is contained in:
@@ -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};
|
||||||
|
|||||||
+11
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user