Skip to content

Commit 5d9108d

Browse files
committed
adopt custom view icon
1 parent fa1ff06 commit 5d9108d

2 files changed

Lines changed: 4 additions & 10 deletions

File tree

src/vs/workbench/browser/parts/compositeBar.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,7 @@ export class CompositeDragAndDrop implements ICompositeDragAndDrop {
133133
}
134134

135135
// ... single view
136-
const defaultContainer = this.viewDescriptorService.getDefaultContainer(draggedViews[0].id);
137-
const canMoveToDefault = !!defaultContainer && this.viewDescriptorService.getViewContainerLocation(defaultContainer) === this.targetContainerLocation;
138-
return !!draggedViews[0].canMoveView && (!!draggedViews[0].containerIcon || canMoveToDefault || this.targetContainerLocation === ViewContainerLocation.Panel);
136+
return !!draggedViews[0].canMoveView;
139137
} else {
140138
// Dragging an individual view
141139
const viewDescriptor = this.viewDescriptorService.getViewDescriptor(dragData.id);
@@ -146,7 +144,7 @@ export class CompositeDragAndDrop implements ICompositeDragAndDrop {
146144
}
147145

148146
// ... to create a view container
149-
return this.targetContainerLocation === ViewContainerLocation.Panel || !!viewDescriptor.containerIcon;
147+
return true;
150148
}
151149
}
152150
}

src/vs/workbench/services/views/browser/viewDescriptorService.ts

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,11 +445,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
445445
}
446446

447447
moveViewToLocation(view: IViewDescriptor, location: ViewContainerLocation): void {
448-
let container = this.getDefaultContainer(view.id)!;
449-
if (this.getViewContainerLocation(container) !== location) {
450-
container = this.registerViewContainerForSingleView(view, location);
451-
}
452-
448+
let container = this.registerViewContainerForSingleView(view, location);
453449
this.moveViewsToContainer([view], container);
454450
}
455451

@@ -491,7 +487,7 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
491487
id,
492488
ctorDescriptor: new SyncDescriptor(ViewPaneContainer, [id, `${id}.state`, { mergeViewWithContainerWhenSingleView: true }]),
493489
name: sourceView.name,
494-
icon: sourceView.containerIcon,
490+
icon: location === ViewContainerLocation.Sidebar ? sourceView.containerIcon || 'codicon-window' : undefined,
495491
hideIfEmpty: true
496492
}, location);
497493
}

0 commit comments

Comments
 (0)