mirror of
https://github.com/mathuo/dockview
synced 2025-05-01 17:18:27 +00:00
feat: addGroup initial sizes
This commit is contained in:
parent
9d4f4cb534
commit
2dc0dafa5a
@ -1640,7 +1640,12 @@ export class DockviewComponent
|
||||
);
|
||||
|
||||
const group = this.createGroup(options);
|
||||
this.doAddGroup(group, relativeLocation);
|
||||
const size =
|
||||
this.getLocationOrientation(relativeLocation) ===
|
||||
Orientation.VERTICAL
|
||||
? options.initialHeight
|
||||
: options.initialWidth;
|
||||
this.doAddGroup(group, relativeLocation, size);
|
||||
if (!options.skipSetActive) {
|
||||
this.doSetGroupAndPanelActive(group);
|
||||
}
|
||||
@ -1654,6 +1659,13 @@ export class DockviewComponent
|
||||
}
|
||||
}
|
||||
|
||||
private getLocationOrientation(location: number[]) {
|
||||
return location.length % 2 == 0 &&
|
||||
this.gridview.orientation === Orientation.HORIZONTAL
|
||||
? Orientation.HORIZONTAL
|
||||
: Orientation.VERTICAL;
|
||||
}
|
||||
|
||||
removeGroup(
|
||||
group: DockviewGroupPanel,
|
||||
options?:
|
||||
|
@ -52,6 +52,8 @@ interface CoreGroupOptions {
|
||||
hideHeader?: boolean;
|
||||
skipSetActive?: boolean;
|
||||
constraints?: Partial<Contraints>;
|
||||
initialWidth?: number;
|
||||
initialHeight?: number;
|
||||
}
|
||||
|
||||
export interface GroupOptions extends CoreGroupOptions {
|
||||
|
Loading…
Reference in New Issue
Block a user