mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-17 02:51:36 -05:00
Fix resource viewer grid resizing (#13197)
* Fix resource viewer grid resizing * keep height
This commit is contained in:
@@ -115,6 +115,7 @@ export class ResourceViewerInput extends EditorInput {
|
|||||||
resizable: col.resizable ?? true,
|
resizable: col.resizable ?? true,
|
||||||
tooltip: col.tooltip,
|
tooltip: col.tooltip,
|
||||||
width: col.width,
|
width: col.width,
|
||||||
|
minWidth: col.width,
|
||||||
type: col.type
|
type: col.type
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -79,7 +79,6 @@ export class ResourceViewerEditor extends EditorPane {
|
|||||||
resourceViewerTableContainer.className = 'resource-viewer-table monaco-editor';
|
resourceViewerTableContainer.className = 'resource-viewer-table monaco-editor';
|
||||||
resourceViewerTableContainer.style.width = '100%';
|
resourceViewerTableContainer.style.width = '100%';
|
||||||
resourceViewerTableContainer.style.height = '100%';
|
resourceViewerTableContainer.style.height = '100%';
|
||||||
resourceViewerTableContainer.style.overflow = 'hidden';
|
|
||||||
resourceViewerTableContainer.style.position = 'relative';
|
resourceViewerTableContainer.style.position = 'relative';
|
||||||
this._resourceViewerTable = this._register(this._instantiationService.createInstance(ResourceViewerTable, resourceViewerTableContainer));
|
this._resourceViewerTable = this._register(this._instantiationService.createInstance(ResourceViewerTable, resourceViewerTableContainer));
|
||||||
return resourceViewerTableContainer;
|
return resourceViewerTableContainer;
|
||||||
@@ -130,8 +129,10 @@ export class ResourceViewerEditor extends EditorPane {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public layout(dimension: DOM.Dimension): void {
|
public layout(dimension: DOM.Dimension): void {
|
||||||
|
this._resourceViewerTable.layout();
|
||||||
this._container.style.width = dimension.width + 'px';
|
this._container.style.width = dimension.width + 'px';
|
||||||
this._container.style.height = dimension.height + 'px';
|
const actionbarHeight = DOM.getTotalHeight(this._actionBar.getContainer());
|
||||||
|
this._container.style.height = (dimension.height - actionbarHeight) + 'px';
|
||||||
}
|
}
|
||||||
|
|
||||||
private showContextMenu(anchor: ContextMenuAnchor, context: azdata.DataGridItem): void {
|
private showContextMenu(anchor: ContextMenuAnchor, context: azdata.DataGridItem): void {
|
||||||
|
|||||||
@@ -49,8 +49,7 @@ export class ResourceViewerTable extends Disposable {
|
|||||||
this._dataView.sort(args);
|
this._dataView.sort(args);
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
dataItemColumnValueExtractor: dataGridColumnValueExtractor,
|
dataItemColumnValueExtractor: dataGridColumnValueExtractor
|
||||||
forceFitColumns: true
|
|
||||||
}));
|
}));
|
||||||
|
|
||||||
this._resourceViewerTable.setSelectionModel(new RowSelectionModel());
|
this._resourceViewerTable.setSelectionModel(new RowSelectionModel());
|
||||||
@@ -95,6 +94,7 @@ export class ResourceViewerTable extends Disposable {
|
|||||||
|
|
||||||
public set columns(columns: Slick.Column<Slick.SlickData>[]) {
|
public set columns(columns: Slick.Column<Slick.SlickData>[]) {
|
||||||
this._resourceViewerTable.columns = columns;
|
this._resourceViewerTable.columns = columns;
|
||||||
|
this._resourceViewerTable.autosizeColumns();
|
||||||
}
|
}
|
||||||
|
|
||||||
public set loading(isLoading: boolean) {
|
public set loading(isLoading: boolean) {
|
||||||
@@ -113,6 +113,11 @@ export class ResourceViewerTable extends Disposable {
|
|||||||
this._resourceViewerTable.unregisterPlugin(plugin);
|
this._resourceViewerTable.unregisterPlugin(plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public layout(): void {
|
||||||
|
this._resourceViewerTable.resizeCanvas();
|
||||||
|
this._resourceViewerTable.autosizeColumns();
|
||||||
|
}
|
||||||
|
|
||||||
public focus(): void {
|
public focus(): void {
|
||||||
this._resourceViewerTable.focus();
|
this._resourceViewerTable.focus();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user