Skip to content

Commit

Permalink
fixes #16738, fixes #16730
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero committed Dec 7, 2016
1 parent 9cc0a04 commit 28ce2ba
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions src/vs/workbench/parts/viewpicker/browser/viewPickerHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,19 @@ export class ViewPickerHandler extends QuickOpenHandler {
return true;
});

let lastCategory: string;
entries.forEach((e, index) => {
if (lastCategory !== e.getCategory()) {
lastCategory = e.getCategory();

e.setShowBorder(index > 0);
e.setGroupLabel(lastCategory);
} else {
e.setShowBorder(false);
e.setGroupLabel(void 0);
}
});

return TPromise.as(new QuickOpenModel(entries));
}

Expand All @@ -107,10 +120,6 @@ export class ViewPickerHandler extends QuickOpenHandler {
const viewsCategory = nls.localize('views', "Views");
const entry = new ViewEntry(viewlet.name, viewsCategory, () => this.viewletService.openViewlet(viewlet.id, true).done(null, errors.onUnexpectedError));
viewEntries.push(entry);

if (index === 0) {
entry.setGroupLabel(viewsCategory);
}
});

const terminals = this.terminalService.terminalInstances;
Expand All @@ -130,10 +139,6 @@ export class ViewPickerHandler extends QuickOpenHandler {
panels.forEach((panel, index) => {
const panelsCategory = nls.localize('panels', "Panels");
const entry = new ViewEntry(panel.name, panelsCategory, () => this.panelService.openPanel(panel.id, true).done(null, errors.onUnexpectedError));
if (index === 0) {
entry.setShowBorder(true);
entry.setGroupLabel(panelsCategory);
}

viewEntries.push(entry);
});
Expand All @@ -147,11 +152,6 @@ export class ViewPickerHandler extends QuickOpenHandler {
}, errors.onUnexpectedError);
});

if (index === 0) {
entry.setShowBorder(true);
entry.setGroupLabel(terminalsCategory);
}

viewEntries.push(entry);
});

Expand All @@ -161,11 +161,6 @@ export class ViewPickerHandler extends QuickOpenHandler {
const outputCategory = nls.localize('channels', "Output");
const entry = new ViewEntry(channel.label, outputCategory, () => this.outputService.getChannel(channel.id).show().done(null, errors.onUnexpectedError));

if (index === 0) {
entry.setShowBorder(true);
entry.setGroupLabel(outputCategory);
}

viewEntries.push(entry);
});

Expand Down

0 comments on commit 28ce2ba

Please sign in to comment.