mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-16 10:58:30 -05:00
fixed the issue with tree component layout (#2174)
This commit is contained in:
@@ -23,8 +23,9 @@ import { IContextViewService } from 'vs/platform/contextview/browser/contextView
|
||||
import { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||
import { DefaultFilter, DefaultAccessibilityProvider, DefaultController } from 'vs/base/parts/tree/browser/treeDefaults';
|
||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
||||
import { ITreeComponentItem, IModelViewTreeViewDataProvider } from 'sql/workbench/common/views';
|
||||
import { ITreeComponentItem } from 'sql/workbench/common/views';
|
||||
import { TreeViewDataProvider } from './treeViewDataProvider';
|
||||
import { getContentHeight, getContentWidth } from 'vs/base/browser/dom';
|
||||
|
||||
class Root implements ITreeComponentItem {
|
||||
label = 'root';
|
||||
@@ -123,13 +124,21 @@ export default class TreeComponent extends ComponentBase implements IComponent,
|
||||
|
||||
public layout(): void {
|
||||
this._changeRef.detectChanges();
|
||||
this.createTreeControl();
|
||||
if (this._tree) {
|
||||
this._tree.layout(this.convertSizeToNumber(this.width), this.convertSizeToNumber(this.height));
|
||||
|
||||
this.layoutTree();
|
||||
this._tree.refresh();
|
||||
}
|
||||
}
|
||||
|
||||
private layoutTree(): void {
|
||||
let width: number = this.convertSizeToNumber(this.width);
|
||||
let height: number = this.convertSizeToNumber(this.height);
|
||||
this._tree.layout(
|
||||
height && height > 0 ? height : getContentHeight(this._inputContainer.nativeElement),
|
||||
width && width > 0 ? width : getContentWidth(this._inputContainer.nativeElement));
|
||||
}
|
||||
|
||||
public setLayout(layout: any): void {
|
||||
// TODO allow configuring the look and feel
|
||||
|
||||
|
||||
Reference in New Issue
Block a user