Sfoglia il codice sorgente

Make the command-palette names for the left/right side bar commands “Toggle” instead of “Show”

This follows the pattern from the single-document mode.
Jason Grout 7 anni fa
parent
commit
f4b9d25f41
1 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. 6 4
      packages/application-extension/src/index.ts

+ 6 - 4
packages/application-extension/src/index.ts

@@ -254,7 +254,8 @@ function addCommands(app: JupyterLab, palette: ICommandPalette): void {
 
   command = CommandIDs.toggleLeftArea;
   app.commands.addCommand(command, {
-    label: 'Show Left Area',
+    label: args => args['isPalette'] ?
+    'Toggle Left Area' : 'Show Left Area',
     execute: () => {
       if (app.shell.leftCollapsed) {
         app.shell.expandLeft();
@@ -265,11 +266,12 @@ function addCommands(app: JupyterLab, palette: ICommandPalette): void {
     isToggled: () => !app.shell.leftCollapsed,
     isVisible: () => !app.shell.isEmpty('left')
   });
-  palette.addItem({ command, category });
+  palette.addItem({ command, category, args: { 'isPalette': true } });
 
   command = CommandIDs.toggleRightArea;
   app.commands.addCommand(command, {
-    label: 'Show Right Area',
+    label: args => args['isPalette'] ?
+    'Toggle Right Area' : 'Show Right Area',
     execute: () => {
       if (app.shell.rightCollapsed) {
         app.shell.expandRight();
@@ -280,7 +282,7 @@ function addCommands(app: JupyterLab, palette: ICommandPalette): void {
     isToggled: () => !app.shell.rightCollapsed,
     isVisible: () => !app.shell.isEmpty('right')
   });
-  palette.addItem({ command, category });
+  palette.addItem({ command, category, args: { 'isPalette': true } });
 
   command = CommandIDs.togglePresentationMode;
   app.commands.addCommand(command, {