mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -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 { attachListStyler } from 'vs/platform/theme/common/styler';
|
||||||
import { DefaultFilter, DefaultAccessibilityProvider, DefaultController } from 'vs/base/parts/tree/browser/treeDefaults';
|
import { DefaultFilter, DefaultAccessibilityProvider, DefaultController } from 'vs/base/parts/tree/browser/treeDefaults';
|
||||||
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation';
|
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 { TreeViewDataProvider } from './treeViewDataProvider';
|
||||||
|
import { getContentHeight, getContentWidth } from 'vs/base/browser/dom';
|
||||||
|
|
||||||
class Root implements ITreeComponentItem {
|
class Root implements ITreeComponentItem {
|
||||||
label = 'root';
|
label = 'root';
|
||||||
@@ -123,13 +124,21 @@ export default class TreeComponent extends ComponentBase implements IComponent,
|
|||||||
|
|
||||||
public layout(): void {
|
public layout(): void {
|
||||||
this._changeRef.detectChanges();
|
this._changeRef.detectChanges();
|
||||||
this.createTreeControl();
|
|
||||||
if (this._tree) {
|
if (this._tree) {
|
||||||
this._tree.layout(this.convertSizeToNumber(this.width), this.convertSizeToNumber(this.height));
|
|
||||||
|
this.layoutTree();
|
||||||
this._tree.refresh();
|
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 {
|
public setLayout(layout: any): void {
|
||||||
// TODO allow configuring the look and feel
|
// TODO allow configuring the look and feel
|
||||||
|
|
||||||
|
|||||||
2
src/sql/sqlops.proposed.d.ts
vendored
2
src/sql/sqlops.proposed.d.ts
vendored
@@ -408,7 +408,7 @@ declare module 'sqlops' {
|
|||||||
label?: string;
|
label?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface TreeProperties {
|
export interface TreeProperties extends ComponentProperties {
|
||||||
withCheckbox?: boolean;
|
withCheckbox?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user