mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-14 12:11:43 +01:00
Layout terminals after they are created
This commit is contained in:
@@ -45,6 +45,7 @@ export class TerminalInstance implements ITerminalInstance {
|
||||
// TODO: Improve HTML element names?
|
||||
private wrapperElement: HTMLDivElement;
|
||||
private terminalDomElement: HTMLDivElement;
|
||||
// TODO: Is font needed, just grab off configHelper?
|
||||
private font: ITerminalFont;
|
||||
|
||||
public constructor(
|
||||
@@ -73,6 +74,8 @@ export class TerminalInstance implements ITerminalInstance {
|
||||
throw new Error('The terminal instance has already been attached to a container');
|
||||
}
|
||||
|
||||
this.setFont(this.configHelper.getFont());
|
||||
|
||||
this.wrapperElement = document.createElement('div');
|
||||
DOM.addClass(this.wrapperElement, 'terminal-wrapper');
|
||||
this.terminalDomElement = document.createElement('div');
|
||||
@@ -136,6 +139,8 @@ export class TerminalInstance implements ITerminalInstance {
|
||||
|
||||
this.wrapperElement.appendChild(this.terminalDomElement);
|
||||
this.container.appendChild(this.wrapperElement);
|
||||
|
||||
this.layout(new Dimension(this.container.offsetWidth, this.container.offsetHeight));
|
||||
}
|
||||
|
||||
public copySelection(): void {}
|
||||
|
||||
@@ -79,7 +79,9 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
|
||||
if (!dimension) {
|
||||
return;
|
||||
}
|
||||
console.log('layout panel', dimension);
|
||||
this.terminalService.terminalInstances.forEach((t) => {
|
||||
console.log('layout instance t');
|
||||
t.layout(dimension);
|
||||
});
|
||||
}
|
||||
@@ -240,8 +242,10 @@ export class TerminalPanel extends Panel implements ITerminalPanel {
|
||||
`line-height: ${newFont.lineHeight};` +
|
||||
'}';
|
||||
this.font = newFont;
|
||||
this.terminalService.terminalInstances.forEach((t) => {
|
||||
t.setFont(newFont);
|
||||
});
|
||||
}
|
||||
this.terminalService.getActiveInstance().setFont(newFont);
|
||||
this.layout(new Dimension(this.parentDomElement.offsetWidth, this.parentDomElement.offsetHeight));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user