diff --git a/src/dlangide/ui/commands.d b/src/dlangide/ui/commands.d index 790019a..67b514b 100644 --- a/src/dlangide/ui/commands.d +++ b/src/dlangide/ui/commands.d @@ -16,6 +16,7 @@ enum IDEActions : int { FileSaveAll, FileClose, FileExit, + EditPreferences, BuildWorkspace, RebuildWorkspace, CleanWorkspace, @@ -66,6 +67,11 @@ const Action ACTION_EDIT_PASTE = (new Action(EditorActions.Paste, "MENU_EDIT_PAS const Action ACTION_EDIT_CUT = (new Action(EditorActions.Cut, "MENU_EDIT_CUT"c, "edit-cut"c, KeyCode.KEY_X, KeyFlag.Control)).disableByDefault(); const Action ACTION_EDIT_UNDO = (new Action(EditorActions.Undo, "MENU_EDIT_UNDO"c, "edit-undo"c, KeyCode.KEY_Z, KeyFlag.Control)).disableByDefault(); const Action ACTION_EDIT_REDO = (new Action(EditorActions.Redo, "MENU_EDIT_REDO"c, "edit-redo"c, KeyCode.KEY_Z, KeyFlag.Control|KeyFlag.Shift)).disableByDefault(); +const Action ACTION_EDIT_INDENT = (new Action(EditorActions.Tab, "MENU_EDIT_INDENT"c, "edit-indent"c, KeyCode.TAB, 0)).disableByDefault(); +const Action ACTION_EDIT_UNINDENT = (new Action(EditorActions.BackTab, "MENU_EDIT_UNINDENT"c, "edit-unindent", KeyCode.TAB, KeyFlag.Shift)).disableByDefault(); +const Action ACTION_EDIT_TOGGLE_LINE_COMMENT = (new Action(EditorActions.Redo, "MENU_EDIT_TOGGLE_LINE_COMMENT"c, null, KeyCode.KEY_DIVIDE, KeyFlag.Control)).disableByDefault(); +const Action ACTION_EDIT_TOGGLE_BLOCK_COMMENT = (new Action(EditorActions.Redo, "MENU_EDIT_TOGGLE_BLOCK_COMMENT"c, null, KeyCode.KEY_DIVIDE, KeyFlag.Control|KeyFlag.Shift)).disableByDefault(); +const Action ACTION_EDIT_PREFERENCES = (new Action(EditorActions.Redo, "MENU_EDIT_PREFERENCES"c, null)); const Action ACTION_HELP_ABOUT = new Action(IDEActions.HelpAbout, "MENU_HELP_ABOUT"c); const Action ACTION_WINDOW_CLOSE_ALL_DOCUMENTS = new Action(IDEActions.WindowCloseAllDocuments, "MENU_WINDOW_CLOSE_ALL_DOCUMENTS"c); const Action ACTION_CREATE_NEW_WORKSPACE = new Action(IDEActions.CreateNewWorkspace, "Create new workspace"d); diff --git a/src/dlangide/ui/frame.d b/src/dlangide/ui/frame.d index 7a31c70..4638847 100644 --- a/src/dlangide/ui/frame.d +++ b/src/dlangide/ui/frame.d @@ -300,8 +300,11 @@ class IDEFrame : AppFrame { MenuItem editItem = new MenuItem(new Action(2, "MENU_EDIT")); editItem.add(ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, ACTION_EDIT_UNDO, ACTION_EDIT_REDO); + MenuItem editItemAdvanced = new MenuItem(new Action(221, "MENU_EDIT_ADVANCED")); + editItemAdvanced.add(ACTION_EDIT_INDENT, ACTION_EDIT_UNINDENT, ACTION_EDIT_TOGGLE_LINE_COMMENT, ACTION_EDIT_TOGGLE_BLOCK_COMMENT); + editItem.add(editItemAdvanced); - editItem.add(new Action(20, "MENU_EDIT_PREFERENCES")); + editItem.add(ACTION_EDIT_PREFERENCES); MenuItem projectItem = new MenuItem(new Action(21, "MENU_PROJECT")); projectItem.add(ACTION_PROJECT_SET_STARTUP, ACTION_PROJECT_REFRESH, ACTION_PROJECT_UPDATE_DEPENDENCIES, ACTION_PROJECT_SETTINGS); @@ -356,7 +359,7 @@ class IDEFrame : AppFrame { tb = res.getOrAddToolbar("Edit"); tb.addButtons(ACTION_EDIT_COPY, ACTION_EDIT_PASTE, ACTION_EDIT_CUT, ACTION_SEPARATOR, - ACTION_EDIT_UNDO, ACTION_EDIT_REDO); + ACTION_EDIT_UNDO, ACTION_EDIT_REDO, ACTION_EDIT_INDENT, ACTION_EDIT_UNINDENT); return res; } diff --git a/views/res/i18n/en.ini b/views/res/i18n/en.ini index f49e621..7f27a32 100644 --- a/views/res/i18n/en.ini +++ b/views/res/i18n/en.ini @@ -17,6 +17,11 @@ MENU_EDIT_PASTE=&Paste MENU_EDIT_CUT=Cu&t MENU_EDIT_UNDO=&Undo MENU_EDIT_REDO=&Redo +MENU_EDIT_INDENT=Indent block +MENU_EDIT_UNINDENT=Unindent block +MENU_EDIT_TOGGLE_LINE_COMMENT=Toggle line comment +MENU_EDIT_TOGGLE_BLOCK_COMMENT=Toggle block comment +MENU_EDIT_ADVANCED=Advanced... MENU_EDIT_PREFERENCES=&Preferences MENU_BUILD=&BUILD MENU_BUILD_WORKSPACE_BUILD=Build Workspace diff --git a/views/res/mdpi/edit-indent.png b/views/res/mdpi/edit-indent.png new file mode 100644 index 0000000..ffd0730 Binary files /dev/null and b/views/res/mdpi/edit-indent.png differ diff --git a/views/res/mdpi/edit-unindent.png b/views/res/mdpi/edit-unindent.png new file mode 100644 index 0000000..1e6f2cd Binary files /dev/null and b/views/res/mdpi/edit-unindent.png differ diff --git a/views/resources.list b/views/resources.list index 383c363..37875a2 100644 --- a/views/resources.list +++ b/views/resources.list @@ -11,9 +11,11 @@ res/mdpi/document-save-as.png res/mdpi/document-save.png res/mdpi/edit-copy.png res/mdpi/edit-cut.png +res/mdpi/edit-indent.png res/mdpi/edit-paste.png res/mdpi/edit-redo.png res/mdpi/edit-undo.png +res/mdpi/edit-unindent.png res/mdpi/project-development.png res/mdpi/project-open.png res/mdpi/run-build.png