Fix horizontal split view not working (#23889)

* Horizontal splitview sorta working

* remove the old element

* support getting size from model view container

* cleanup

* make splitViewHeight optional

* Update src/sql/azdata.proposed.d.ts

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>

* fix test

---------

Co-authored-by: Charles Gagnon <chgagnon@microsoft.com>
This commit is contained in:
Kim Santiago
2023-07-17 12:31:04 -10:00
committed by GitHub
parent 0e17a05985
commit eeab2b4abe
7 changed files with 49 additions and 24 deletions

View File

@@ -57,21 +57,19 @@ export function createTwoComponentFlexContainer(view: azdata.ModelView, firstCom
/**
* Creates a vertical splitview
* @param view
* @param topComponent
* @param bottomComponent
* @param splitViewHeight
* @param firstComponent
* @param secondComponent
* @param orientation orientation of the split view - horizontal or vertical
* @returns Vertical SplitViewContainer with the top and bottom components
*/
export function createVerticalSplitView(view: azdata.ModelView, topComponent: azdata.Component, bottomComponent: azdata.Component, splitViewHeight: number): azdata.SplitViewContainer {
// TODO: figure out why the horizontal spliview isn't working
export function createSplitView(view: azdata.ModelView, firstComponent: azdata.Component, secondComponent: azdata.Component, orientation: string): azdata.SplitViewContainer {
const splitview = <azdata.SplitViewContainer>view.modelBuilder.splitViewContainer().component();
splitview.addItem(topComponent);
splitview.addItem(bottomComponent);
splitview.addItem(firstComponent);
splitview.addItem(secondComponent);
splitview.setLayout({
orientation: 'vertical',
splitViewHeight: splitViewHeight
orientation: orientation,
splitViewSize: undefined // setting this to undefined will default the splitview size to use the model view container's size
});
return splitview;