mirror of
https://github.com/mathuo/dockview
synced 2025-10-10 01:48:04 +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);
|
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) {
|
if (!options.skipSetActive) {
|
||||||
this.doSetGroupAndPanelActive(group);
|
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(
|
removeGroup(
|
||||||
group: DockviewGroupPanel,
|
group: DockviewGroupPanel,
|
||||||
options?:
|
options?:
|
||||||
|
@ -52,6 +52,8 @@ interface CoreGroupOptions {
|
|||||||
hideHeader?: boolean;
|
hideHeader?: boolean;
|
||||||
skipSetActive?: boolean;
|
skipSetActive?: boolean;
|
||||||
constraints?: Partial<Contraints>;
|
constraints?: Partial<Contraints>;
|
||||||
|
initialWidth?: number;
|
||||||
|
initialHeight?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface GroupOptions extends CoreGroupOptions {
|
export interface GroupOptions extends CoreGroupOptions {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user