提交 750ab895 编写于 作者: B Benjamin Pasero

fix #96225

上级 3670914e
...@@ -87,6 +87,9 @@ export class ActivitybarPart extends Part implements IActivityBarService { ...@@ -87,6 +87,9 @@ export class ActivitybarPart extends Part implements IActivityBarService {
private content: HTMLElement | undefined; private content: HTMLElement | undefined;
private homeBar: ActionBar | undefined;
private homeBarContainer: HTMLElement | undefined;
private menuBar: CustomMenubarControl | undefined; private menuBar: CustomMenubarControl | undefined;
private menuBarContainer: HTMLElement | undefined; private menuBarContainer: HTMLElement | undefined;
...@@ -353,20 +356,20 @@ export class ActivitybarPart extends Part implements IActivityBarService { ...@@ -353,20 +356,20 @@ export class ActivitybarPart extends Part implements IActivityBarService {
} }
private createHomeBar(command: string, title: string, icon: Codicon): void { private createHomeBar(command: string, title: string, icon: Codicon): void {
const homeBarContainer = document.createElement('div'); this.homeBarContainer = document.createElement('div');
homeBarContainer.setAttribute('aria-label', nls.localize('homeIndicator', "Home")); this.homeBarContainer.setAttribute('aria-label', nls.localize('homeIndicator', "Home"));
homeBarContainer.setAttribute('role', 'toolbar'); this.homeBarContainer.setAttribute('role', 'toolbar');
addClass(homeBarContainer, 'home-bar'); addClass(this.homeBarContainer, 'home-bar');
const homeActionBar = this._register(new ActionBar(homeBarContainer, { this.homeBar = this._register(new ActionBar(this.homeBarContainer, {
orientation: ActionsOrientation.VERTICAL, orientation: ActionsOrientation.VERTICAL,
animated: false animated: false
})); }));
homeActionBar.push(this._register(this.instantiationService.createInstance(HomeAction, command, title, icon)), { icon: true, label: false }); this.homeBar.push(this._register(this.instantiationService.createInstance(HomeAction, command, title, icon)), { icon: true, label: false });
const content = assertIsDefined(this.content); const content = assertIsDefined(this.content);
content.prepend(homeBarContainer); content.prepend(this.homeBarContainer);
} }
updateStyles(): void { updateStyles(): void {
...@@ -582,12 +585,15 @@ export class ActivitybarPart extends Part implements IActivityBarService { ...@@ -582,12 +585,15 @@ export class ActivitybarPart extends Part implements IActivityBarService {
// Layout composite bar // Layout composite bar
let availableHeight = contentAreaSize.height; let availableHeight = contentAreaSize.height;
if (this.globalActivityActionBar) { if (this.homeBarContainer) {
availableHeight -= (this.globalActivityActionBar.viewItems.length * ActivitybarPart.ACTION_HEIGHT); // adjust height for global actions showing availableHeight -= this.homeBarContainer.clientHeight;
} }
if (this.menuBarContainer) { if (this.menuBarContainer) {
availableHeight -= this.menuBarContainer.clientHeight; availableHeight -= this.menuBarContainer.clientHeight;
} }
if (this.globalActivityActionBar) {
availableHeight -= (this.globalActivityActionBar.viewItems.length * ActivitybarPart.ACTION_HEIGHT); // adjust height for global actions showing
}
this.compositeBar.layout(new Dimension(width, availableHeight)); this.compositeBar.layout(new Dimension(width, availableHeight));
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册