Add New Window action in file menu

This commit is contained in:
JannisX11 2021-11-11 21:23:27 +01:00
parent f46e9ea855
commit e45f1f64c4
5 changed files with 16 additions and 8 deletions

View File

@ -1478,6 +1478,14 @@ const BARS = {
})
//File
new Action('new_window', {
icon: 'open_in_new',
category: 'file',
condition: isApp,
click: function () {
ipcRenderer.send('new-window');
}
})
new Action('open_model_folder', {
icon: 'folder_open',
category: 'file',

View File

@ -542,6 +542,7 @@ const MenuBar = {
},
'open_model',
'open_from_link',
'new_window',
'_',
'save_project',
'save_project_as',

View File

@ -782,6 +782,7 @@ class Texture {
showContextMenu(event) {
var scope = this;
scope.select()
Prop.active_panel = 'textures'
this.menu.open(event, scope)
}
openMenu() {
@ -1135,14 +1136,7 @@ class Texture {
name: 'menu.texture.change',
click: function(texture) { texture.reopen()}
},
{
icon: 'delete',
name: 'generic.delete',
click: function(texture) {
Undo.initEdit({textures: [texture], selected_texture: true, bitmap: true})
texture.remove()
Undo.finishEdit('Delete texture', {textures: [], selected_texture: true, bitmap: true})
}},
'delete',
'_',
{
icon: 'list',

View File

@ -819,6 +819,8 @@
"action.project_window": "Project...",
"action.project_window.desc": "Opens the project window, where you can edit metadata of your model",
"action.new_window": "New Window",
"action.new_window.desc": "Opens a new Blockbench window",
"action.open_model_folder": "Open Model Folder",
"action.open_model_folder.desc": "Opens the folder that the model is contained in",
"action.open_backup_folder": "Open Backup Folder",

View File

@ -184,6 +184,9 @@ ipcMain.on('edit-launch-setting', (event, arg) => {
ipcMain.on('add-recent-project', (event, path) => {
app.addRecentDocument(path);
})
ipcMain.on('new-window', (event, path) => {
createWindow(true);
})
ipcMain.on('request-color-picker', async (event, arg) => {
const color = await getColorHexRGB().catch((error) => {
console.warn('[Error] Failed to pick color', error)