From 9a803ed22515860abeb2acc8af92fe99f1ca38a2 Mon Sep 17 00:00:00 2001 From: MartinGC94 Date: Fri, 15 May 2020 01:34:14 +0200 Subject: [PATCH 1/3] Add buttons for moving the terminal around. --- package.json | 42 +++++++++++++++++++++++++++++ resources/dark/ClosePanel.svg | 9 +++++++ resources/dark/MovePanelBottom.svg | 10 +++++++ resources/dark/MovePanelLeft.svg | 10 +++++++ resources/light/ClosePanel.svg | 9 +++++++ resources/light/MovePanelBottom.svg | 10 +++++++ resources/light/MovePanelLeft.svg | 10 +++++++ 7 files changed, 100 insertions(+) create mode 100644 resources/dark/ClosePanel.svg create mode 100644 resources/dark/MovePanelBottom.svg create mode 100644 resources/dark/MovePanelLeft.svg create mode 100644 resources/light/ClosePanel.svg create mode 100644 resources/light/MovePanelBottom.svg create mode 100644 resources/light/MovePanelLeft.svg diff --git a/package.json b/package.json index aa59cc55e1..767738cacc 100644 --- a/package.json +++ b/package.json @@ -265,6 +265,33 @@ "command": "PowerShell.InvokeRegisteredEditorCommand", "title": "Invoke Registered Editor Command", "category": "PowerShell" + }, + { + "command": "workbench.action.closePanel", + "title": "Close panel", + "category": "PowerShell", + "icon": { + "light": "resources/light/ClosePanel.svg", + "dark": "resources/dark/ClosePanel.svg" + } + }, + { + "command": "workbench.action.positionPanelLeft", + "title": "Move panel left", + "category": "PowerShell", + "icon": { + "light": "resources/light/MovePanelLeft.svg", + "dark": "resources/dark/MovePanelLeft.svg" + } + }, + { + "command": "workbench.action.positionPanelBottom", + "title": "Move panel to bottom", + "category": "PowerShell", + "icon": { + "light": "resources/light/MovePanelBottom.svg", + "dark": "resources/dark/MovePanelBottom.svg" + } } ], "menus": { @@ -305,6 +332,21 @@ } ], "editor/title": [ + { + "when": "editorLangId == powershell", + "command": "workbench.action.positionPanelBottom", + "group": "navigation@97" + }, + { + "when": "editorLangId == powershell", + "command": "workbench.action.positionPanelLeft", + "group": "navigation@98" + }, + { + "when": "editorLangId == powershell", + "command": "workbench.action.closePanel", + "group": "navigation@99" + }, { "when": "editorLangId == powershell", "command": "workbench.action.debug.start", diff --git a/resources/dark/ClosePanel.svg b/resources/dark/ClosePanel.svg new file mode 100644 index 0000000000..2feafe7c06 --- /dev/null +++ b/resources/dark/ClosePanel.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/resources/dark/MovePanelBottom.svg b/resources/dark/MovePanelBottom.svg new file mode 100644 index 0000000000..8284a0976d --- /dev/null +++ b/resources/dark/MovePanelBottom.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/resources/dark/MovePanelLeft.svg b/resources/dark/MovePanelLeft.svg new file mode 100644 index 0000000000..d7f7797e4c --- /dev/null +++ b/resources/dark/MovePanelLeft.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/resources/light/ClosePanel.svg b/resources/light/ClosePanel.svg new file mode 100644 index 0000000000..5db309662e --- /dev/null +++ b/resources/light/ClosePanel.svg @@ -0,0 +1,9 @@ + + + + + + + + + \ No newline at end of file diff --git a/resources/light/MovePanelBottom.svg b/resources/light/MovePanelBottom.svg new file mode 100644 index 0000000000..739c933e30 --- /dev/null +++ b/resources/light/MovePanelBottom.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file diff --git a/resources/light/MovePanelLeft.svg b/resources/light/MovePanelLeft.svg new file mode 100644 index 0000000000..06c569437b --- /dev/null +++ b/resources/light/MovePanelLeft.svg @@ -0,0 +1,10 @@ + + + + + + + + + + \ No newline at end of file From 346f1b3a7770ff6e85d56ad4277fde4f6f8ac518 Mon Sep 17 00:00:00 2001 From: MartinGC94 Date: Sat, 16 May 2020 00:54:37 +0200 Subject: [PATCH 2/3] Add button visibility options. --- package.json | 35 +++++++++++++++++++++++++++----- src/features/ISECompatibility.ts | 3 +++ src/settings.ts | 19 +++++++++++++++++ 3 files changed, 52 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 767738cacc..66f3a8f8fb 100644 --- a/package.json +++ b/package.json @@ -333,27 +333,27 @@ ], "editor/title": [ { - "when": "editorLangId == powershell", + "when": "editorLangId == powershell && config.powershell.buttons.MovePanelToBottomButtonVisibility", "command": "workbench.action.positionPanelBottom", "group": "navigation@97" }, { - "when": "editorLangId == powershell", + "when": "editorLangId == powershell && config.powershell.buttons.MovePanelLeftButtonVisibility", "command": "workbench.action.positionPanelLeft", "group": "navigation@98" }, { - "when": "editorLangId == powershell", + "when": "editorLangId == powershell && config.powershell.buttons.ClosePanelButtonVisibility", "command": "workbench.action.closePanel", "group": "navigation@99" }, { - "when": "editorLangId == powershell", + "when": "editorLangId == powershell && config.powershell.buttons.RunButtonVisibility", "command": "workbench.action.debug.start", "group": "navigation@100" }, { - "when": "editorLangId == powershell", + "when": "editorLangId == powershell && config.powershell.buttons.RunSelectionButtonVisibility", "command": "PowerShell.RunSelection", "group": "navigation@101" } @@ -842,6 +842,31 @@ ], "default": "Diagnostic", "description": "Defines the verbosity of output to be used when debugging a test or a block. For Pester 5 and newer the default value Diagnostic will print additional information about discovery, skipped and filtered tests, mocking and more." + }, + "powershell.buttons.RunButtonVisibility": { + "type": "boolean", + "default": true, + "description": "Show the Run button in the editor titlebar." + }, + "powershell.buttons.RunSelectionButtonVisibility": { + "type": "boolean", + "default": true, + "description": "Show the Run Selection button in the editor titlebar." + }, + "powershell.buttons.ClosePanelButtonVisibility": { + "type": "boolean", + "default": false, + "description": "Show the Close panel button in the editor titlebar." + }, + "powershell.buttons.MovePanelLeftButtonVisibility": { + "type": "boolean", + "default": false, + "description": "Show the Move panel left button in the editor titlebar." + }, + "powershell.buttons.MovePanelToBottomButtonVisibility": { + "type": "boolean", + "default": false, + "description": "Show the Move panel to bottom button in the editor titlebar." } } }, diff --git a/src/features/ISECompatibility.ts b/src/features/ISECompatibility.ts index 6bdf3f1edf..be181745f4 100644 --- a/src/features/ISECompatibility.ts +++ b/src/features/ISECompatibility.ts @@ -24,6 +24,9 @@ export class ISECompatibilityFeature implements IFeature { { path: "powershell.integratedConsole", name: "focusConsoleOnExecute", value: false }, { path: "files", name: "defaultLanguage", value: "powershell" }, { path: "workbench", name: "colorTheme", value: "PowerShell ISE" }, + { path: "powershell.buttons", name: "ClosePanelButtonVisibility", value: true }, + { path: "powershell.buttons", name: "MovePanelLeftButtonVisibility", value: true }, + { path: "powershell.buttons", name: "MovePanelToBottomButtonVisibility", value: true } ]; private iseCommandRegistration: vscode.Disposable; private defaultCommandRegistration: vscode.Disposable; diff --git a/src/settings.ts b/src/settings.ts index 00c98f326f..22f29c916d 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -100,6 +100,7 @@ export interface ISettings { bugReporting?: IBugReportingSettings; sideBar?: ISideBarSettings; pester?: IPesterSettings; + buttons?: IButtonSettings; } export interface IStartAsLoginShellSettings { @@ -125,6 +126,14 @@ export interface IPesterSettings { debugOutputVerbosity?: string; } +export interface IButtonSettings { + RunButtonVisibility?: boolean; + RunSelectionButtonVisibility?: boolean; + ClosePanelButtonVisibility?: boolean; + MovePanelLeftButtonVisibility?: boolean; + MovePanelToBottomButtonVisibility?: boolean; +} + export function load(): ISettings { const configuration: vscode.WorkspaceConfiguration = vscode.workspace.getConfiguration( @@ -192,6 +201,14 @@ export function load(): ISettings { CommandExplorerVisibility: true, }; + const defaultButtonSettings: IButtonSettings = { + RunButtonVisibility: true, + RunSelectionButtonVisibility: true, + ClosePanelButtonVisibility: false, + MovePanelLeftButtonVisibility: false, + MovePanelToBottomButtonVisibility: false + }; + const defaultPesterSettings: IPesterSettings = { useLegacyCodeLens: true, outputVerbosity: "FromPreference", @@ -237,6 +254,8 @@ export function load(): ISettings { configuration.get("sideBar", defaultSideBarSettings), pester: configuration.get("pester", defaultPesterSettings), + buttons: + configuration.get("buttons", defaultButtonSettings), startAsLoginShell: // tslint:disable-next-line // We follow the same convention as VS Code - https://github.com/microsoft/vscode/blob/ff00badd955d6cfcb8eab5f25f3edc86b762f49f/src/vs/workbench/contrib/terminal/browser/terminal.contribution.ts#L105-L107 From 9a8f304c0120dd6cac1099280ddc4e3d08672b61 Mon Sep 17 00:00:00 2001 From: MartinGC94 Date: Tue, 19 May 2020 19:14:14 +0200 Subject: [PATCH 3/3] Simplified button visibility options. --- package.json | 33 +++++++++----------------------- src/features/ISECompatibility.ts | 4 +--- src/settings.ts | 14 ++++---------- 3 files changed, 14 insertions(+), 37 deletions(-) diff --git a/package.json b/package.json index 66f3a8f8fb..4e97be2f34 100644 --- a/package.json +++ b/package.json @@ -333,27 +333,27 @@ ], "editor/title": [ { - "when": "editorLangId == powershell && config.powershell.buttons.MovePanelToBottomButtonVisibility", + "when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons", "command": "workbench.action.positionPanelBottom", "group": "navigation@97" }, { - "when": "editorLangId == powershell && config.powershell.buttons.MovePanelLeftButtonVisibility", + "when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons", "command": "workbench.action.positionPanelLeft", "group": "navigation@98" }, { - "when": "editorLangId == powershell && config.powershell.buttons.ClosePanelButtonVisibility", + "when": "editorLangId == powershell && config.powershell.buttons.showPanelMovementButtons", "command": "workbench.action.closePanel", "group": "navigation@99" }, { - "when": "editorLangId == powershell && config.powershell.buttons.RunButtonVisibility", + "when": "editorLangId == powershell && config.powershell.buttons.showRunButtons", "command": "workbench.action.debug.start", "group": "navigation@100" }, { - "when": "editorLangId == powershell && config.powershell.buttons.RunSelectionButtonVisibility", + "when": "editorLangId == powershell && config.powershell.buttons.showRunButtons", "command": "PowerShell.RunSelection", "group": "navigation@101" } @@ -843,30 +843,15 @@ "default": "Diagnostic", "description": "Defines the verbosity of output to be used when debugging a test or a block. For Pester 5 and newer the default value Diagnostic will print additional information about discovery, skipped and filtered tests, mocking and more." }, - "powershell.buttons.RunButtonVisibility": { + "powershell.buttons.showRunButtons": { "type": "boolean", "default": true, - "description": "Show the Run button in the editor titlebar." + "description": "Show the Run and Run Selection buttons in the editor titlebar." }, - "powershell.buttons.RunSelectionButtonVisibility": { - "type": "boolean", - "default": true, - "description": "Show the Run Selection button in the editor titlebar." - }, - "powershell.buttons.ClosePanelButtonVisibility": { - "type": "boolean", - "default": false, - "description": "Show the Close panel button in the editor titlebar." - }, - "powershell.buttons.MovePanelLeftButtonVisibility": { - "type": "boolean", - "default": false, - "description": "Show the Move panel left button in the editor titlebar." - }, - "powershell.buttons.MovePanelToBottomButtonVisibility": { + "powershell.buttons.showPanelMovementButtons": { "type": "boolean", "default": false, - "description": "Show the Move panel to bottom button in the editor titlebar." + "description": "Show buttons in the editor titlebar for moving the panel around." } } }, diff --git a/src/features/ISECompatibility.ts b/src/features/ISECompatibility.ts index be181745f4..4e8d8d07dc 100644 --- a/src/features/ISECompatibility.ts +++ b/src/features/ISECompatibility.ts @@ -24,9 +24,7 @@ export class ISECompatibilityFeature implements IFeature { { path: "powershell.integratedConsole", name: "focusConsoleOnExecute", value: false }, { path: "files", name: "defaultLanguage", value: "powershell" }, { path: "workbench", name: "colorTheme", value: "PowerShell ISE" }, - { path: "powershell.buttons", name: "ClosePanelButtonVisibility", value: true }, - { path: "powershell.buttons", name: "MovePanelLeftButtonVisibility", value: true }, - { path: "powershell.buttons", name: "MovePanelToBottomButtonVisibility", value: true } + { path: "powershell.buttons", name: "showPanelMovementButtons", value: true } ]; private iseCommandRegistration: vscode.Disposable; private defaultCommandRegistration: vscode.Disposable; diff --git a/src/settings.ts b/src/settings.ts index 22f29c916d..defbdd9e7a 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -127,11 +127,8 @@ export interface IPesterSettings { } export interface IButtonSettings { - RunButtonVisibility?: boolean; - RunSelectionButtonVisibility?: boolean; - ClosePanelButtonVisibility?: boolean; - MovePanelLeftButtonVisibility?: boolean; - MovePanelToBottomButtonVisibility?: boolean; + showRunButtons?: boolean; + showPanelMovementButtons?: boolean; } export function load(): ISettings { @@ -202,11 +199,8 @@ export function load(): ISettings { }; const defaultButtonSettings: IButtonSettings = { - RunButtonVisibility: true, - RunSelectionButtonVisibility: true, - ClosePanelButtonVisibility: false, - MovePanelLeftButtonVisibility: false, - MovePanelToBottomButtonVisibility: false + showRunButtons: true, + showPanelMovementButtons: false }; const defaultPesterSettings: IPesterSettings = {