Skip to content

Commit 572ccd1

Browse files
authored
SCM - group statusbar commands (microsoft#182195)
1 parent b259712 commit 572ccd1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/vs/workbench/contrib/scm/browser/activity.ts

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { VIEW_PANE_ID, ISCMService, ISCMRepository, ISCMViewService } from 'vs/w
1111
import { IActivityService, NumberBadge } from 'vs/workbench/services/activity/common/activity';
1212
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
1313
import { IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
14-
import { IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/workbench/services/statusbar/browser/statusbar';
14+
import { IStatusbarEntry, IStatusbarService, StatusbarAlignment as MainThreadStatusBarAlignment } from 'vs/workbench/services/statusbar/browser/statusbar';
1515
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
1616
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
1717
import { EditorResourceAccessor } from 'vs/workbench/common/editor';
@@ -167,13 +167,18 @@ export class SCMStatusController implements IWorkbenchContribution {
167167
repoAgnosticActionName = '';
168168
}
169169

170-
disposables.add(this.statusbarService.addEntry({
170+
const statusbarEntry: IStatusbarEntry = {
171171
name: localize('status.scm', "Source Control") + (repoAgnosticActionName ? ` ${repoAgnosticActionName}` : ''),
172172
text: command.title,
173173
ariaLabel: tooltip,
174174
tooltip,
175175
command: command.id ? command : undefined
176-
}, `status.scm.${index}`, MainThreadStatusBarAlignment.LEFT, 10000 - index));
176+
};
177+
178+
disposables.add(index === 0 ?
179+
this.statusbarService.addEntry(statusbarEntry, `status.scm.${index}`, MainThreadStatusBarAlignment.LEFT, 10000) :
180+
this.statusbarService.addEntry(statusbarEntry, `status.scm.${index}`, MainThreadStatusBarAlignment.LEFT, { id: `status.scm.${index - 1}`, alignment: MainThreadStatusBarAlignment.RIGHT, compact: true })
181+
);
177182
}
178183

179184
this.statusBarDisposable = disposables;

0 commit comments

Comments
 (0)