소스 검색

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 년 전
부모
커밋
f4b9d25f41
1개의 변경된 파일6개의 추가작업 그리고 4개의 파일을 삭제
  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, {