mirror of
https://github.com/mathuo/dockview
synced 2025-03-09 15:32:03 +00:00
Merge pull request #497 from mathuo/479-is-there-any-way-to-focus-the-panel-content
feat: events
This commit is contained in:
commit
30c7fa2c6a
@ -61,6 +61,7 @@ export class DockviewGroupPanelApiImpl extends GridviewPanelApiImpl {
|
||||
options.group ??
|
||||
this.accessor.addGroup({
|
||||
direction: positionToDirection(options.position ?? 'right'),
|
||||
skipSetActive: true,
|
||||
});
|
||||
|
||||
this.accessor.moveGroupOrPanel({
|
||||
|
@ -795,15 +795,17 @@ export class DockviewComponent
|
||||
skipPopoutAssociated: true,
|
||||
});
|
||||
} else {
|
||||
const removedGroup = this.doRemoveGroup(group, {
|
||||
skipDispose: true,
|
||||
skipActive: true,
|
||||
});
|
||||
removedGroup.model.renderContainer =
|
||||
this.overlayRenderContainer;
|
||||
removedGroup.model.location = { type: 'grid' };
|
||||
this.doAddGroup(removedGroup, [0]);
|
||||
this.doSetGroupAndPanelActive(removedGroup);
|
||||
if (this.getPanel(group.id)) {
|
||||
const removedGroup = this.doRemoveGroup(group, {
|
||||
skipDispose: true,
|
||||
skipActive: true,
|
||||
});
|
||||
removedGroup.model.renderContainer =
|
||||
this.overlayRenderContainer;
|
||||
removedGroup.model.location = { type: 'grid' };
|
||||
this.doAddGroup(removedGroup, [0]);
|
||||
this.doSetGroupAndPanelActive(removedGroup);
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
@ -1594,7 +1596,9 @@ export class DockviewComponent
|
||||
const group = this.orthogonalize(
|
||||
directionToPosition(<Direction>options.direction)
|
||||
);
|
||||
this.doSetGroupAndPanelActive(group);
|
||||
if (!options.skipSetActive) {
|
||||
this.doSetGroupAndPanelActive(group);
|
||||
}
|
||||
return group;
|
||||
}
|
||||
|
||||
@ -1607,7 +1611,9 @@ export class DockviewComponent
|
||||
target
|
||||
);
|
||||
this.doAddGroup(group, relativeLocation);
|
||||
this.doSetGroupAndPanelActive(group);
|
||||
if (!options.skipSetActive) {
|
||||
this.doSetGroupAndPanelActive(group);
|
||||
}
|
||||
return group;
|
||||
} else {
|
||||
this.doAddGroup(group);
|
||||
@ -1922,11 +1928,13 @@ export class DockviewComponent
|
||||
for (const panel of panels) {
|
||||
to.model.openPanel(panel, {
|
||||
skipSetActive: panel !== activePanel,
|
||||
skipSetGroupActive: panel !== activePanel,
|
||||
skipSetGroupActive: true,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
this.doSetGroupAndPanelActive(to);
|
||||
|
||||
panels.forEach((panel) => {
|
||||
this._onDidMovePanel.fire({ panel });
|
||||
});
|
||||
|
@ -38,6 +38,7 @@ interface GroupMoveEvent {
|
||||
interface CoreGroupOptions {
|
||||
locked?: DockviewGroupPanelLocked;
|
||||
hideHeader?: boolean;
|
||||
skipSetActive?: boolean;
|
||||
}
|
||||
|
||||
export interface GroupOptions extends CoreGroupOptions {
|
||||
|
Loading…
Reference in New Issue
Block a user