dockview icon indicating copy to clipboard operation
dockview copied to clipboard

Implement default width and height for Dockview panels

Open qcz opened this issue 1 year ago • 3 comments

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.

qcz avatar Apr 28 '24 11:04 qcz

Hi @qcz, Did u implement this feature?

shashi-drishya avatar Jun 20 '24 12:06 shashi-drishya

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.

qcz avatar Jun 20 '24 13:06 qcz

Tracking in https://github.com/mathuo/dockview/issues/640

mathuo avatar Jul 11 '24 20:07 mathuo

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 https://github.com/mathuo/dockview/issues/708 for continued work on group size preservation

mathuo avatar Sep 05 '24 18:09 mathuo