Use a proportional space 50%-50% when dropping a window in a Container(as Visual Studio does)

Docking/MDI for WPF Forum

Posted 2 months ago by Santi Arilla
Version: 19.1.0684
Avatar

Hi,

Currently when I drop a "floating" window into a slot of a container, and there is another window docked, the already docked window takes mostly all the space (around 80%) and the dropped one takes a small space (around 20%). Is there any way to make them take the same space 50%-50% when I drop the window?, even when the pre-dropping "shadow" appears. I've noticed that Visual Studio behaves in that way, so I guess it's possible

Thank you

Comments (6)

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Santi,

The way we have our docking windows is that when you drag a tool window out of a docked state, it tries to float the tool window with the same size.  Then when you drag back to a dock guide to dock it, it tries to dock at the same size as the floating state, but I believe it caps that at around 50% to avoid completely taking over the space.  The design behind all of this is that it figures you sized your tool window to a certain size and it does its best to keep it at that intended size instead of randomly increasing it.

To sum up, if you have a tall tool window and you dock it at the bottom of a tall docked tool window, it will take at most 50% of the height.  If you have a more "landscape" tool window (200px tall and wider than that) and dock that at the bottom of a tall docked tool window, it will try and keep that same floating height in what is dropped.  Thus it could end up being 20% in that case.

As for Visual Studio, it doesn't appear to always be 50%/50%, which you can see if you start docking three or four tool windows in a row.  And it seems to change based on the height of the tool window (in my tests when docking vertically), yet it doesn't match the same size as the floating tool window, which seems wrong.  

We are open to further discussing this if after the explanation above you still would like to see changes, or at least options for change.


Actipro Software Support

Posted 2 months ago by Santi Arilla
Avatar

Hi!

Thanks for you reply! Testing my code, as you said, I've noticed that it depends on the size of the floating window, so as bigger the floating window is as bigger will be the initial docked size of that window (at most 50% of the space). My question now is: Is there any way to dock the windows like they are bigger, even when they are little? I want my windows be docked to 50% of the space when there are 2 windows docked, 33% when they're 3, 25% when they are 4.... I want them to use a proportional space, at least initially, and even if when they are floating, they was little.

Thank you and regards.

Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

I don't believe there is a way in the current codebase to do that externally.  It would require altering our internal code, with a new option added, to achieve this.  I will write down notes from this conversation with the feature request item.

I can see what you mean when there is no Workspace in the split container.  But what if you have a Workspace (80% of width) and a tool window (20% of width) docked on the right side.  Then you drag another tool window to the left of the already-docked tool window?  What should happen in that case?  Do we go with existing logic, or would you like to see some proportional logic there too?


Actipro Software Support

Posted 2 months ago by Santi Arilla
Avatar

Hello again,

I want to be as proportional as it's possible, so, in the case you are describing, I would like to see some proportional logic there too.

Another case could be 2 windows docked horizontally, I mean one up and other down. In that case:

  • If I drop a window next (on the side) to the upper window, I want it to be proportional (50% of the space in that case) just for the window above, the window below stay using 100% of the space.
  • And If I drop the window on the side of both horizontal windows, this two horizontal windows would use half of the space toghether, and the new one the other half

I don't know if Its clear enough to understand it.

Thanks!

The latest build of this product (v2019.1 build 0685) was released 2 months ago, which was before the next post in this thread.
Posted 2 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Thank you for the information.  We've made a TODO item for this request and have marked down this thread with it to track the request details.


Actipro Software Support

Posted 2 months ago by Santi Arilla
Avatar

Thank you very much. :)

Add Comment

Please log in to a validated account to post comments.