Skip to content

Commit

Permalink
Add New Window action in file menu
Browse files Browse the repository at this point in the history
  • Loading branch information
JannisX11 committed Nov 11, 2021
1 parent f46e9ea commit e45f1f6
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 8 deletions.
8 changes: 8 additions & 0 deletions js/interface/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
1 change: 1 addition & 0 deletions js/interface/menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -542,6 +542,7 @@ const MenuBar = {
},
'open_model',
'open_from_link',
'new_window',
'_',
'save_project',
'save_project_as',
Expand Down
10 changes: 2 additions & 8 deletions js/texturing/textures.js
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ class Texture {
showContextMenu(event) {
var scope = this;
scope.select()
Prop.active_panel = 'textures'
this.menu.open(event, scope)
}
openMenu() {
Expand Down Expand Up @@ -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',
Expand Down
2 changes: 2 additions & 0 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e45f1f6

Please sign in to comment.