ui-layout icon indicating copy to clipboard operation
ui-layout copied to clipboard

Layout does not resize properly

Open widmoser opened this issue 10 years ago • 4 comments

When moving the slider before resizing strange things happen. Consider the following plunker:

  1. Open the plunker in a separate window
  2. Resize the window (make it smaller)
  3. Move the slider to the left
  4. Resize the window (make it larger)
  5. The ui-layout does not fill the whole screen anymore.

Similarly:

  1. Move the slider to the left
  2. Resize the window (make it smaller)
  3. A horizontal scrollbar appears (the ui-layout takes up too much space)

widmoser avatar Dec 03 '15 10:12 widmoser

It can be fixed, by setting one of the layout containers to central (see plunker). So the current behaviour is that when the window is resized, all containers keep their size (and thus overflowing) unless at least one of the containers is set to central. An overflow can still be produced, when scaling the left (red) container to a bigger size and resizing the window so that it is smaller than the container. I would suggest the following improvements:

  • Improve documentation to reflect the current layouting behaviour in more detail
  • Provide a layouting option that resizes the containers proportionally (according to their current size, including auto sized containers)
  • Provide a layouting option that resizes the container proportionally, but first resizes auto-sized containers until their size is 0 and then starts resizing containers proportionally.

Since I need this feature soon, I can help with implementing it.

widmoser avatar Dec 03 '15 11:12 widmoser

@widmoser Any ETA ? Thanks.

tony0918 avatar Feb 25 '16 07:02 tony0918

Before I start on this, I would like to agree on a resizing semantics with the project maintainers. Because it's a topic that is not so clear how to do it right and I think it makes sense to discuss it through before committing to something. What makes it complicated is the fact that an auto-sized container can have a min/max width. We need to find an algorithm, that scales auto-sized containers until their min/max width in a way that makes sense. There will still be cases where the bug in this issue appears. Consider for example the case where there is an autosized container with a max-width of 50%. When we scale the other container which is not auto-sized to < 50%, there is no way the ui-layout can fill the whole 100%.

widmoser avatar Feb 25 '16 08:02 widmoser

It looks like if we don't drag splitter, there is no issue existed. Right?

tony0918 avatar Feb 25 '16 08:02 tony0918