Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need an easy to to know if a panel/group is floating #583

Open
ztolley opened this issue Apr 25, 2024 · 1 comment
Open

Need an easy to to know if a panel/group is floating #583

ztolley opened this issue Apr 25, 2024 · 1 comment
Labels
question Further information is requested

Comments

@ztolley
Copy link

ztolley commented Apr 25, 2024

I am building a layout in which I want users to be able to click on a control to make panel float and if floating provide an alternative button to dock the panel or hide the float button.

As it stands its easy to make a panel float with containerApi.addFloatingGroup(activePanel) but there is no easy generic way to know if the panel is part of a floating group or not while constructing the function for rightHeaderActionsComponent.

@mathuo
Copy link
Owner

mathuo commented Apr 25, 2024

Both the panel and group api object expose a location property as an object:

type DockviewGroupLocation = {
    type: 'grid';
} | {
    type: 'floating';
} | {
    type: 'popout';
    getWindow: () => Window;
};

For example api.location.type for floating groups should be equal to floating.

I realize now though this may not be well documented, let me know if this is what you are looking for though?

@mathuo mathuo added the question Further information is requested label Apr 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants