Skip to content

Commit

Permalink
chore: new project, window, file shortcut change
Browse files Browse the repository at this point in the history
  • Loading branch information
abose committed Dec 28, 2023
1 parent 39f954b commit c017dc6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
10 changes: 2 additions & 8 deletions src/base-config/keyboard.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
{
"file.newFile": [
"Alt-N"
],
"file.newFolder": [
"Ctrl-Alt-N"
],
"file.new_window": [
"Alt-Shift-N"
"Ctrl-M"
],
"file.open": [
"Ctrl-O"
Expand All @@ -30,7 +24,7 @@
"Ctrl-Shift-S"
],
"file.liveFilePreview": [
"Ctrl-Alt-P"
"Ctrl-Alt-L"
],
"file.reloadLivePreview": [
{
Expand Down
7 changes: 5 additions & 2 deletions src/command/DefaultMenus.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,15 +63,18 @@ define(function (require, exports, module) {
}
}

const fileNewShortcut = Phoenix.browser.isTauri ? "Ctrl-N" : "Ctrl-1";
const fileNewWindowShortcut = Phoenix.browser.isTauri ? "Ctrl-Shift-N" : "Ctrl-3";

AppInit.htmlReady(function () {
/*
* File menu
*/
var menu;
menu = Menus.addMenu(Strings.FILE_MENU, Menus.AppMenuBar.FILE_MENU);
menu.addMenuItem(Commands.FILE_NEW);
menu.addMenuItem(Commands.FILE_NEW, fileNewShortcut);
menu.addMenuItem(Commands.FILE_NEW_FOLDER);
menu.addMenuItem(Commands.FILE_NEW_WINDOW);
menu.addMenuItem(Commands.FILE_NEW_WINDOW, fileNewWindowShortcut);
menu.addMenuDivider();
if(Phoenix.browser.isTauri){
menu.addMenuItem(Commands.FILE_OPEN);
Expand Down
2 changes: 1 addition & 1 deletion src/extensions/default/Phoenix/new-project.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ define(function (require, exports, module) {
function _addMenuEntries() {
CommandManager.register(Strings.CMD_PROJECT_NEW, Commands.FILE_NEW_PROJECT, _showNewProjectDialogue);
const fileMenu = Menus.getMenu(Menus.AppMenuBar.FILE_MENU);
fileMenu.addMenuItem(Commands.FILE_NEW_PROJECT, "Ctrl-Shift-2", Menus.AFTER, Commands.FILE_NEW_FOLDER);
fileMenu.addMenuItem(Commands.FILE_NEW_PROJECT, "Ctrl-Alt-P", Menus.AFTER, Commands.FILE_NEW_FOLDER);
}

function closeDialogue() {
Expand Down

0 comments on commit c017dc6

Please sign in to comment.