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

Implement default width and height for Dockview panels #589

Closed
qcz opened this issue Apr 28, 2024 · 4 comments
Closed

Implement default width and height for Dockview panels #589

qcz opened this issue Apr 28, 2024 · 4 comments
Milestone

Comments

@qcz
Copy link
Contributor

qcz commented Apr 28, 2024

When adding a new panel to the top/right/bottom/left of a panel in a Dockview component, the available space is evenly distributed between the two panels. This is not always a desirable default. For example if I have a narrow tree on the left and a list on right of the center panel, I do not want them to take 1/3-1/3 of the screen. I know I can resize them, but it has its own weird behavior (see #567).

I see that the underlying GridView can handle fixed widths/heights when adding panels.

It should be nice if we could define default widths and/or heights for panels. Default width would be used for the width of a panel when adding to left or right of a panel, and the default height would be used when adding a panel to top or bottom of a panel. Otherwise it would be ignored.

I am willing to try to implement this if the project is interested in this feature.

@shashi-drishya
Copy link

Hi @qcz, Did u implement this feature?

@qcz
Copy link
Contributor Author

qcz commented Jun 20, 2024

Hi @shashi-drishya, @mathuo created an experiment in PR #592 for it.

preferredWidth and preferredHeight works very-very well, but priority seemingly did not work. And it breaks down when two or more panels are grouped together, the preferredWidth/preferredHeight info is lost.

I don't know what the plans of @mathuo for that PR. preferredWidth and preferredHeight support for panels is production ready, but further work may be needed to support it when multiple panels are grouped together.

@mathuo
Copy link
Owner

mathuo commented Jul 11, 2024

Tracking in #640

@mathuo
Copy link
Owner

mathuo commented Sep 5, 2024

1.17.1 Releases changes related to initial, maximum and minimum sizes as well as a small change to prevent group resizing when moving groups.

See http://localhost:3000/docs/core/panels/add#minimum-and-maximum

See #708 for continued work on group size preservation

@mathuo mathuo closed this as completed Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants